Repository navigation
fix: log failed Zoom responses whose body is not JSON - #19
Merged
Merged
Conversation
create_request_log parses a string as JSON, and failed calls handed it response.text. A gateway error or an empty body then raised JSONDecodeError, which replaced Zoom's real error and left nothing in the Integration Request log. Failed calls now log the status code as data and the body as text, and their error messages carry the status code.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A failed Zoom call whose body isn't JSON (a gateway error page, an empty body) crashed inside the logging and hid Zoom's actual error.
create_request_logrunsjson.loadson any string it gets asdata, and the failure paths handed itresponse.text.Changes
log_failed_response(response)inapi.py: logs{"status_code": ...}as data and the body aserror(text, never parsed).api.py, webinar create and add registrant inzoom_webinar.py.Failed to create meeting on Zoom (502): ....Not changed
authenticate()still doesresponse.json()["access_token"], so bad credentials surface as aKeyError. Separate fix.Testing
test_a_failure_with_a_non_json_body_is_logged_and_reported: a 502 with an HTML body raisesValidationErrormentioning 502 and leaves one Failed Integration Request with the status and body. It failed with theJSONDecodeErrorabove before the fix.test_request_logging2/2,test_api8/8,test_zoom_webinar4/4.