Repository navigation
fix: rescue JSON::ParserError in response hook - #354
Merged
Merged
Conversation
Justin Hammond (Justintime50)
marked this pull request as ready for review
November 6, 2026 18:15
JSON::ParseError is not defined by the json gem, so a subscribed response hook and a non-JSON body raised NameError instead of falling back to the raw body.
Justin Hammond (Justintime50)
force-pushed
the
fix_json_parser_error
branch
from
November 6, 2026 18:21
85c3e33 to
ec77a0a
Compare
Rane Gridley (ranebo)
approved these changes
Nov 6, 2026
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.
A subscribed response hook rescued
JSON::ParseError, which the json gem does not define, so a non-JSON body raisedNameErrorinstead of falling through as the raw body. RescueJSON::ParserErrorinstead.Testing: Reproduced the
NameErroron master with the issue's script (json 2.21.2); after the fix the raw body is passed to the hook.just lintandjust testpass.Fixes #353