Skip to content

Include HTTP status code in MalformedResponseException#173

Closed
Lyra-B wants to merge 1 commit into
masterfrom
FRI-15467
Closed

Include HTTP status code in MalformedResponseException#173
Lyra-B wants to merge 1 commit into
masterfrom
FRI-15467

Conversation

@Lyra-B
Copy link
Copy Markdown
Contributor

@Lyra-B Lyra-B commented May 6, 2026

When the API returns a non-2xx response with a body that isn't a valid
JSON error envelope (e.g. an HTML page from Cloudflare), the SDK
previously threw MalformedResponseException with no indication of the
underlying HTTP status, making it hard to distinguish a WAF 403 from
an edge 5xx during triage.

Expose the status code via getStatusCode() and include it in the
exception message alongside a truncated body preview.

@Lyra-B Lyra-B force-pushed the FRI-15467 branch 2 times, most recently from c3d294e to 5b7c8cd Compare May 7, 2026 10:13
  When the API returns a non-2xx response with a body that isn't a valid
  JSON error envelope (e.g. an HTML page from Cloudflare), the SDK
  previously threw MalformedResponseException with no indication of the
  underlying HTTP status, making it hard to distinguish a WAF 403 from
  an edge 5xx during triage.

  Expose the status code via getStatusCode() and include it in the
  exception message alongside a truncated body preview.
@Lyra-B Lyra-B marked this pull request as ready for review May 7, 2026 10:18
@Lyra-B Lyra-B requested a review from a team May 7, 2026 10:32
@Lyra-B
Copy link
Copy Markdown
Contributor Author

Lyra-B commented May 7, 2026

Applied this in the template instead

@Lyra-B Lyra-B closed this May 7, 2026
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.

1 participant