Class SentryExceptionResolver

java.lang.Object
io.sentry.spring.SentryExceptionResolver
All Implemented Interfaces:
Ordered, HandlerExceptionResolver

public class SentryExceptionResolver extends Object implements HandlerExceptionResolver, Ordered
HandlerExceptionResolver implementation that will record any exception that a Spring Controller throws to Sentry. It then returns null, which will let the other (default or custom) exception resolvers handle the actual error.
  • Field Details

  • Constructor Details

    • SentryExceptionResolver

      public SentryExceptionResolver(@NotNull @NotNull IHub hub, @NotNull @NotNull TransactionNameProvider transactionNameProvider, int order)
  • Method Details

    • resolveException

      @Nullable public @Nullable ModelAndView resolveException(@NotNull @NotNull javax.servlet.http.HttpServletRequest request, @NotNull @NotNull javax.servlet.http.HttpServletResponse response, @Nullable @Nullable Object handler, @NotNull @NotNull Exception ex)
      Specified by:
      resolveException in interface HandlerExceptionResolver
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface Ordered
    • createEvent

      @NotNull protected @NotNull SentryEvent createEvent(@NotNull @NotNull javax.servlet.http.HttpServletRequest request, @NotNull @NotNull Exception ex)
    • createHint

      @Nullable protected @Nullable Hint createHint(@NotNull @NotNull javax.servlet.http.HttpServletRequest request, @NotNull @NotNull javax.servlet.http.HttpServletResponse response)