类 SimpleActionMappingMethodExceptionHandler

java.lang.Object
cn.taketoday.core.OrderedSupport
所有已实现的接口:
cn.taketoday.core.Ordered, HandlerExceptionHandler

@Experimental public class SimpleActionMappingMethodExceptionHandler extends AbstractActionMappingMethodExceptionHandler
write 'classpath:error/xxx.png' for RenderedImage
从以下版本开始:
4.0 2022/3/3 11:28
作者:
Harry Yang
  • 构造器详细资料

    • SimpleActionMappingMethodExceptionHandler

      public SimpleActionMappingMethodExceptionHandler()
  • 方法详细资料

    • handleInternal

      @Nullable protected Object handleInternal(RequestContext context, @Nullable HandlerMethod handlerMethod, Throwable ex) throws Exception
      Actually resolve the given exception that got thrown during on handler execution, returning a view(result) that represents a specific error page if appropriate.

      May be overridden in subclasses, in order to apply specific exception checks. Note that this template method will be invoked after checking whether this resolved applies ("mappedHandlers" etc), so an implementation may simply proceed with its actual exception handling.

      指定者:
      handleInternal 在类中 AbstractActionMappingMethodExceptionHandler
      参数:
      context - current HTTP request
      handlerMethod - the executed handler method, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
      ex - the exception that got thrown during handler execution
      返回:
      a corresponding ModelAndView to forward to, or null for default processing
      抛出:
      Exception
    • writeErrorMessage

      protected void writeErrorMessage(Throwable ex, RequestContext context) throws IOException
      Write error message to request context, default is write json
      参数:
      ex - Throwable that occurred in request handler
      context - current request context
      抛出:
      IOException
    • buildDefaultErrorMessage

      protected String buildDefaultErrorMessage(Throwable ex)
    • getErrorStatusValue

      public int getErrorStatusValue(Throwable ex)
      Get error http status value, if target throwable is HttpStatusCodeProvider its return from HttpStatusCodeProvider.getStatusCode()
      参数:
      ex - Throwable that occurred in request handler
      返回:
      Http status code