Skip to content

fix npe when storage responds with an error

Rustam Lotsmanenko (EPAM) requested to merge fix-storage-respons-npe into master

Type of change

  • Bug Fix
  • Feature

When Dataset receives from Storage response with an error it cannot process it and returns an internal server error which is confusing. The reason is that HttpResponseBodyMapper was not injected in DatasetRegistryServiceImpl.

Caused by: java.lang.NullPointerException
2022-06-02 09:48:15.050 MSK
dataset at org.opengroup.osdu.dataset.service.DatasetRegistryServiceImpl.createOrUpdateDatasetRegistry(DatasetRegistryServiceImpl.java:123)

Does this introduce a change in the core logic?

  • [YES]

Does this introduce a change in the cloud provider implementation, if so which cloud?

  • AWS
  • Azure
  • GCP
  • IBM
  • Common code

Does this introduce a breaking change?

  • [NO]

What is the current behavior?

Any error response from Storage is causing an internal server error at Dataset.

What is the new/expected behavior?

Error responses processed normally and users may understand what was the reason for the error. Ex:

{
    "code": 400,
    "reason": "Storage Service: Error on writing record",
    "message": "Could not find group \"data.osdu.viewers@osdu.osdu-gcp.go3-nrg.projects.epam.com\"."
}
Edited by Rustam Lotsmanenko (EPAM)

Merge request reports