Skip to content

Some callbacks do not have their Exceptions caught yet #2123

Closed
Listed in
@adinauer

Description

@adinauer

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.init param Sentry.OptionsConfiguration<SentryAndroidOptions> configuration
  • Local scope callback for captureX methods with param ScopeCallback 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

Activity

moved this to Needs Discussion in [DEPRECATED] Mobile SDKson Jun 22, 2022
philipphofmann

philipphofmann commented on Jun 23, 2022

@philipphofmann
Member

If we decide to throw away the event, we should ensure this information ends up in client reports.

marandaneto

marandaneto commented on Jun 24, 2022

@marandaneto
Contributor

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.

moved this from Needs Discussion to Backlog in [DEPRECATED] Mobile SDKson Jun 29, 2022
moved this from Backlog to In Progress in [DEPRECATED] Mobile SDKson Oct 7, 2022
markushi

markushi commented on Oct 11, 2022

@markushi
Member

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

  • Integration
  • ISentryClient
  • ILogger
  • IEnvelopeReader.read
  • IDebugImagesLoader
  • IEnvelopeCache
  • IEnvelopeReader
  • HostnameVerifier
  • SSLSocketFactory
  • ISerializer
  • ITransactionProfiler
  • ITransportFactory
  • ITransportGate
  • ISentryExecutorService
  • IScopeObserver
  • IClientReportRecorder

5 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @markushi@philipphofmann@adinauer@marandaneto

    Issue actions

      Some callbacks do not have their Exceptions caught yet · Issue #2123 · getsentry/sentry-java