sentry-java
sentry-java copied to clipboard
Some callbacks do not have their Exceptions caught yet
Integration
sentry
Java Version
any
Version
6.1.2
Steps to Reproduce
There are multiple places where an Exception thrown by a callback is not caught.
SentryAndroid.initparamSentry.OptionsConfiguration<SentryAndroidOptions> configuration- Local scope callback for
captureXmethods with paramScopeCallback callback - ... there's probably more
Expected Result
Exceptions should be caught and we should downgrade gracefully (throw away an event, don't enable the SDK, ...).
Actual Result
Exceptions are not caught
If we decide to throw away the event, we should ensure this information ends up in client reports.
If we decide to throw away the event, we should ensure this information ends up in client reports.
Actually, it's the opposite, by swallowing the exception during eg beforeSend, we make sure that events get sent.
Potential callbacks which should not crash:
via Sentry
| item | has try/catch | has logging | note |
|---|---|---|---|
init / OptionsConfiguration<T>.configure |
x | x |
via Hub
| item | has try/catch | has logging | note |
|---|---|---|---|
withScope(..., ScopeCallback) |
x | x | |
configureScope(..., ScopeCallback) |
x | x | |
captureEvent(..., ScopeCallback) |
x | x | |
captureMesssage(..., ScopeCallback) |
x | x | |
captureException(..., ScopeCallback) |
x | x |
via SentryOptions
| item | has try/catch | has logging | note |
|---|---|---|---|
BeforeSendCallback |
x | x | called by SentryClient.captureEvent |
BeforeBreadcrumbCallback |
x | x | called by Scope.addBreadcrumb |
TracesSamplerCallback |
x | x | called by TracesSampler.sample |
ProfilesSamplerCallback |
x | x | called by TracesSampler.sample |
Ignored for custom implementations of
IntegrationISentryClientILoggerIEnvelopeReader.readIDebugImagesLoaderIEnvelopeCacheIEnvelopeReaderHostnameVerifierSSLSocketFactoryISerializerITransactionProfilerITransportFactoryITransportGateISentryExecutorServiceIScopeObserverIClientReportRecorder