Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Raise ApiError for request errors #11

Merged
merged 5 commits into from
Jun 20, 2024

Conversation

davidgrayston-paddle
Copy link
Contributor

@davidgrayston-paddle davidgrayston-paddle commented Jun 14, 2024

Fixed

  • Client._make_request now raises an ApiError (or resolved sub class if implemented, e.g. AddressApiError), which provides the following properties:
    • error_type
    • error_code
    • detail
    • docs_url
    • field_errors (list)
      • field
      • error
  • ApiError extends requests.HTTPError and so also has response object available.
  • Client._make_request now logs repr(api_error) to provide more detail about the error.

Relates to #10

@davidgrayston-paddle davidgrayston-paddle force-pushed the fix-improve-error-response-handling branch from 0116ace to a2623c8 Compare June 14, 2024 19:15
@davidgrayston-paddle davidgrayston-paddle force-pushed the fix-improve-error-response-handling branch from a2623c8 to 30e0286 Compare June 15, 2024 19:48
@davidgrayston-paddle davidgrayston-paddle force-pushed the fix-improve-error-response-handling branch from 30e0286 to 90666d5 Compare June 15, 2024 19:51
vifer
vifer previously approved these changes Jun 20, 2024
Copy link
Contributor

@vifer vifer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might need to bump the version + changelog entry 😄

@davidgrayston-paddle
Copy link
Contributor Author

We might need to bump the version + changelog entry 😄

Version and changelog now updated for 0.1.3

Copy link
Contributor

@vifer vifer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@davidgrayston-paddle davidgrayston-paddle merged commit b090b64 into main Jun 20, 2024
5 checks passed
@davidgrayston-paddle davidgrayston-paddle deleted the fix-improve-error-response-handling branch June 20, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants