Class SentryExceptionResolver

  • All Implemented Interfaces:
    org.springframework.core.Ordered, org.springframework.web.servlet.HandlerExceptionResolver

    public class SentryExceptionResolver
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String MECHANISM_TYPE  
      • Fields inherited from interface org.springframework.core.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getOrder()  
      @Nullable org.springframework.web.servlet.ModelAndView resolveException​(@NotNull javax.servlet.http.HttpServletRequest request, @NotNull javax.servlet.http.HttpServletResponse response, @Nullable java.lang.Object handler, @NotNull java.lang.Exception ex)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SentryExceptionResolver

        public SentryExceptionResolver​(@NotNull
                                       @NotNull io.sentry.IHub hub,
                                       @NotNull
                                       @NotNull TransactionNameProvider transactionNameProvider,
                                       int order)
    • Method Detail

      • 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 java.lang.Object handler,
                                                                                       @NotNull
                                                                                       @NotNull java.lang.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