Package io.sentry

Class UncaughtExceptionHandlerIntegration

java.lang.Object
io.sentry.UncaughtExceptionHandlerIntegration
All Implemented Interfaces:
Integration, Closeable, AutoCloseable, Thread.UncaughtExceptionHandler

public final class UncaughtExceptionHandlerIntegration extends Object implements Integration, Thread.UncaughtExceptionHandler, Closeable
Sends any uncaught exception to Sentry, then passes the exception on to the pre-existing uncaught exception handler.
  • Constructor Details

    • UncaughtExceptionHandlerIntegration

      public UncaughtExceptionHandlerIntegration()
  • Method Details

    • register

      public final void register(@NotNull @NotNull IScopes scopes, @NotNull @NotNull SentryOptions options)
      Description copied from interface: Integration
      Registers an integration
      Specified by:
      register in interface Integration
      Parameters:
      scopes - the Scopes
      options - the options
    • uncaughtException

      public void uncaughtException(Thread thread, Throwable thrown)
      Specified by:
      uncaughtException in interface Thread.UncaughtExceptionHandler
    • close

      public void close()
      Remove this UncaughtExceptionHandlerIntegration from the exception handler chain.

      If this integration is currently the default handler, restore the initial handler, if this integration is not the current default call removeFromHandlerTree

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable