Skip to content

Commit f5519fc

Browse files
fix(develop-docs): Handling 400s and 500s disk buffers (#15571)
Make it clearer that SDKS must drop envelopes when getting a 4xx response and SDKs must record client reports in that scenario.
1 parent 92140a9 commit f5519fc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

develop-docs/sdk/expected-features/index.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,13 @@ Write events to disk before attempting to send, so that they can be retried in t
251251

252252
### Dealing With Network Failures
253253

254-
An `HTTP 2xx` status code response from Sentry is considered a successful send. It's important to note that retry is only considered in the event of a network failure. For example:
254+
When SDKs receive an `HTTP 2xx` status code response from Sentry, they **MUST** consider it as a successful send. If Sentry returns an `HTTP 4xx` (excluding `HTTP 429`) or `HTTP 5xx` status code, SDKs **MUST** discard the envelope and record a [client report](/sdk/telemetry/client-reports) with the discard reason `send_error`. For an `HTTP 429` response, SDKs **MUST NOT** record a client report to comply with the [rate limiting](/sdk/expected-features/rate-limiting/) rules, because the backend already records a client report for the rate limit. SDKs **MAY** retry sending the envelope when a network error occurs, such as:
255255

256256
* Connection timeout
257257
* DSN resolution failure
258258
* Connection reset by peer
259259

260-
Other failures, like those caused by processing the file in the SDK itself, the payload should be discarded since those are likely to end up on an endless retry.
261-
If the event reached Sentry and an HTTP response status code was received, even in the event of an `HTTP 500` status code, the event should be discarded.
260+
When other failures occur, like those caused by processing the file in the SDK itself, SDKs **MUST** discard the envelope and record a [client report](/sdk/telemetry/client-reports) with the discard reason `internal_sdk_error`. Otherwise, the SDK might end up in an endless retry loop.
262261

263262

264263
#### Additional capabilities

0 commit comments

Comments
 (0)