You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: develop-docs/sdk/overview.mdx
+16
Original file line number
Diff line number
Diff line change
@@ -294,6 +294,8 @@ happens immediately that may result in a different response code (and message).
294
294
295
295
## Handling Errors
296
296
297
+
### Server Errors
298
+
297
299
We **highly encourage** that your SDK handle failures from the Sentry server
298
300
gracefully. Specifically, SDKs must honor the `429` status code and not attempt
299
301
sending until the `Retry-After` kicks in. SDKs should drop events if Sentry is
@@ -328,6 +330,20 @@ Retrying too often may cause further rate limiting or blocking by the Sentry
328
330
server.
329
331
</Alert>
330
332
333
+
### SDK Errors
334
+
335
+
We try our best to make our SDKs error-free. We are an exception monitoring service after all
336
+
and throwing our own exceptions is awkward. However, if our SDKs do throw exceptions, we have to make
337
+
sure we swallow them gracefully and emit an error level log describing the failure.
338
+
339
+
As a **design principle**, we never capture Sentry events for exceptions happening within our SDKs, including within user-defined callbacks and hooks such as `before_send` or `traces_sampler`.
340
+
341
+
The reason we avoid capturing internal SDK exceptions is that we are already in an event capturing flow
342
+
where the scope has been applied and capturing another event at that point in the lifecycle
343
+
would lead to undefined behavior. In the worst case, we could create a busy loop of creating and sending events repeatedly until the system crashes.
344
+
345
+
In mobile SDKs, unhandled crashes will still make it to Sentry via the crash handlers. See [SDK Crash Detection](https://github.com/getsentry/sentry/tree/master/src/sentry/utils/sdk_crashes#sdk-crash-detection) for more details.
346
+
331
347
## Concurrency (Scope and Hubs)
332
348
333
349
SDKs are supposed to provide standardized concurrency handling through the
0 commit comments