Class SentryExceptionResolver

java.lang.Object
io.sentry.spring.SentryExceptionResolver
All Implemented Interfaces:
org.springframework.core.Ordered, org.springframework.web.servlet.HandlerExceptionResolver

public class SentryExceptionResolver extends Object implements org.springframework.web.servlet.HandlerExceptionResolver, org.springframework.core.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 io.sentry.IHub hub, @NotNull @NotNull TransactionNameProvider transactionNameProvider, int order)
  • Method Details

    • resolveException

      @Nullable public @Nullable org.springframework.web.servlet.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 org.springframework.web.servlet.HandlerExceptionResolver
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered