-
Notifications
You must be signed in to change notification settings - Fork 0
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: Handle non-json error responses #263
fix: Handle non-json error responses #263
Conversation
@andrii-balitskyi we should be able to write a test for this at least for one case |
seam/client.py
Outdated
@@ -76,3 +79,34 @@ def _handle_error_response(self, response: requests.Response): | |||
raise SeamHttpInvalidInputError(error_details, status_code, request_id) | |||
|
|||
raise SeamHttpApiError(error_details, status_code, request_id) | |||
|
|||
def _is_api_error_response(self, response: requests.Response) -> bool: |
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.
If this doesn't use self it can be moved outside of the class and just be a normal internal function
def _is_api_error_response(self, response: requests.Response) -> bool: | |
def is_api_error_response(response: requests.Response) -> bool: |
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.
@razor-x what about using @staticmethod
decorator instead?
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.
Similar, but staticmethod
would really be for something you wanted to expose on the class. This is really just an internal private function.
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.
https://linear.app/seam/issue/CX-121/handle-non-json-error-response