Skip to content

fix(errors): preserve API error details - #156

Merged
Diego Barajas (barajas-d) merged 5 commits into
masterfrom
hotfix/error-detail-fallback
Nov 24, 2026
Merged

Diego Barajas (barajas-d) merged 5 commits into
masterfrom
hotfix/error-detail-fallback

Conversation

@barajas-d

Copy link
Copy Markdown
Contributor

Summary

Preserve useful error details when an API response has no top-level message, such as an Order API 402 body containing errors and data.

Changes

  • Populate exception message and error with the API message, or the complete serialized body when it is absent.
  • Fall back to the HTTP status if the body is empty or cannot be serialized.
  • Apply the same fallback to MPResponse.error_message for unsuccessful responses.
  • Preserve the parsed response in exception.response.

Compatibility

exception.error previously held the API error code; it now contains the message or serialized body. Consumers needing the original code can read exception.response["error"]. The fallback can include all fields in the API response.

Validation

  • Python syntax check and isort check passed.
  • Repository pre-commit checks passed.
  • Automated tests and live Order requests were not run locally.

@barajas-d
Diego Barajas (barajas-d) merged commit a095718 into master Nov 24, 2026
7 checks passed
@barajas-d
Diego Barajas (barajas-d) deleted the hotfix/error-detail-fallback branch November 24, 2026 03:45
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.

2 participants