-
Notifications
You must be signed in to change notification settings - Fork 23
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
improve exception handling #105
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add message for MambuUnprocessableEntityError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add unittest to validate error messages.
tap_mambu/helpers/client.py
Outdated
raise MambuError(error) | ||
except (ValueError, TypeError): | ||
raise MambuError(error) | ||
error_code = 500 if response.status_code > 500 else response.status_code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we treating all 500+ error codes as 500? That doesn't look like a correct approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes,
Logically we are not altering the request based on any http status code (apart from retrying any exception that we come across) this will only be helpful for generating appropriate log statements, but i don't find it necessary to add more exception classes right now, as mambu has over 10,000 error codes, https://support.mambu.com/docs/api-response-error-codes, and those are not the http standard error codes.
adding additional exception classes is not in the scope of this ticket, although they will be addressed in a different PR
Description of change
Manual QA steps
Risks
Rollback steps