Skip to content

Fix datastore exception resolving (GONRG-921)

Type of change

  • Bug Fix

Does this introduce a change in the core logic?

  • [NO]

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

  • AWS
  • Azure
  • GCP
  • IBM

Does this introduce a breaking change?

  • [NO]

What is the current behavior?

Response message comparison , doesn't look reasonable, messages can variate.

if (ex.getCode() == 10 && ex.getMessage().startsWith("too much contention"))

throw new AppException(409, "Conflict", "A DDMS already exists with the same id");

for example it can start with : "Aborted due to cross-transaction contention." while the code & reason of error the same.

What is the new/expected behavior?

Keep only response code comparison.

if (ex.getCode()== 10)

throw new AppException(409, "Conflict", "A DDMS already exists with the same id");

Details about error codes in doc : https://cloud.google.com/datastore/docs/concepts/errors#error_codes code 10 equal ABORTED code

Have you added/updated Unit Tests and Integration Tests?

  • [YES]

Any other useful information

depends on !31 (merged)

Edited by Rustam Lotsmanenko (EPAM)

Merge request reports