The dataset responds with a 500 server error instead of a DMS Service status code.
- The underlying DMS service could respond with varying errors and status codes.
- Especially after the EDS-DMS service introduction.
- But the Dataset service will not respect those responses and will try to parse it as an OK response. Causing parsing errors, and making Dataset response confusing:
{
"code": 500,
"reason": "Internal Server Error",
"message": "Unrecognized field \"code\" (class org.opengroup.osdu.core.common.dms.model.RetrievalInstructionsResponse), not marked as ignorable (one known property: \"datasets\"])_ at [Source: (String)\"{\"code\":401,\"reason\":\"Access denied\",\"message\":\"The user is not authorized to perform this action\"}\"; line: 1, column: 12] (through reference chain: org.opengroup.osdu.core.common.dms.model.RetrievalInstructionsResponse[\"code\"])"
}
Solution:
- check the DMS response code, in case it's not ok do not try to parse it, instead respond with it to the user, highlighting that the error occurred in DMS.
Example:
{
"code": 403,
"reason": "Non-OK response received from DMS service: https://community.gcp.gnrg-osdu.projects.epam.com/api/file/v2/files/storageInstructions",
"message": "RBAC: access denied"
}