Skip to content

feat: name the HTTP status when the error body is not JSON - #68

Merged
mogita merged 1 commit into
masterfrom
fix/cha-4641-error-status-in-message
Aug 12, 2026
Merged

feat: name the HTTP status when the error body is not JSON#68
mogita merged 1 commit into
masterfrom
fix/cha-4641-error-status-in-message

Conversation

@mogita

@mogita mogita commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Ticket

https://linear.app/stream/issue/CHA-4641/generated-sdks-report-the-http-status-when-the-error-body-is-not-json

Summary

When an error body is not JSON, the SDK reported only the parse failure and hid the HTTP status. A customer saw failed to parse error response for a 503 that the edge proxy returned as plain text, plus a JSON parse stack trace, and could not tell which status they got. GetStreamApiException.Message now appends the status: failed to parse error response: unexpected server response code 503. StatusCode, RawResponseBody and the parse cause do not change.

The old text is still the prefix of the new message, so prefix matching and substring matching on it both keep working.

Verification

  • dotnet build --configuration Release: 0 errors.
  • dotnet test --filter FullyQualifiedName~MakeRequestAsync_UnparseableBody: pass.
  • make test: 181 failures, all integration tests that need real credentials. The base commit gives the same 181.

An unparseable error body produced the message "failed to parse error
response", which hid the HTTP status. The message now appends the status
to that text, so prefix matching and substring matching both keep
working. The status code, the raw response body and the parse cause do
not change.
@mogita
mogita force-pushed the fix/cha-4641-error-status-in-message branch from 5f80443 to e41b31f Compare August 12, 2026 18:01
@mogita mogita changed the title fix: name the HTTP status when the error body is not JSON feat: name the HTTP status when the error body is not JSON Aug 12, 2026
@mogita
mogita merged commit 09d9b9b into master Aug 12, 2026
4 checks passed
@mogita
mogita deleted the fix/cha-4641-error-status-in-message branch August 12, 2026 18:49
github-actions Bot added a commit that referenced this pull request Aug 12, 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