Skip to content

fix(errors): expose API error details in exceptions - #425

Open
Diego Barajas (barajas-d) wants to merge 3 commits into
masterfrom
hotfix/error-detail-fallback
Open

Diego Barajas (barajas-d) wants to merge 3 commits into
masterfrom
hotfix/error-detail-fallback

Conversation

@barajas-d

Copy link
Copy Markdown
Contributor

Summary

Make typed API exceptions more useful when Order API returns details in errors[] rather than a top-level message.

Changes

  • Include the HTTP status and available message, error, errors[].code, errors[].message and string errors[].details in the exception message.
  • Fall back to the HTTP status and a reference to the API response when no readable details are available.
  • Keep the full original response available through getApiResponse().getContent().

Compatibility

The exception message changes from a fixed generic string to a message derived from the API response. The exception types and response access remain unchanged.

Validation

  • mvn -q -DskipTests compile passed.
  • Automated tests and live Order requests were not run locally.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant