Skip to content

Fix 2xx response without valid JSON#10

Open
eval wants to merge 1 commit intomasterfrom
body-nils
Open

Fix 2xx response without valid JSON#10
eval wants to merge 1 commit intomasterfrom
body-nils

Conversation

@eval
Copy link
Copy Markdown
Collaborator

@eval eval commented Jan 15, 2026

Before this commit a response was considered successful iff its http status was 2xx. This doesn't handle cases (we ran into) where such responses contain invalid JSON (that with the recent fixes would result in body.nil?). This commit makes response.success? stricter such that HttpError's are raised when parse_body returns nil.

Code Review

Please consider the following checklist when reviewing this Pull Request.
More background and details here.

  • Does the code actually solve the problem it was meant to solve?
  • Is the code covered by unit tests? Integration tests?
  • Does anything here need documentation? (Focus on why, not what.)
  • Does any of this code deal with privacy sensitive information or affects security? Ask an additional reviewer.
  • Is the code easy to understand and change in the future?
  • Is the same code or concept duplicated? Find a balance between DRYness and readability.
  • Does the code reasonably adhere to the Kabisa coding standards?
  • Be kind.

Before this commit a response was considered successful iff its http status was 2xx.
This doesn't handle cases (we ran into) where such responses contain invalid JSON.
This commit makes response.success? stricter such that HttpError's are raised when
parse_body returns nil.
@eval eval requested review from ariejan and rbr January 15, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants