类 ResponseEntityExceptionHandler

java.lang.Object
cn.taketoday.web.handler.ResponseEntityExceptionHandler

public class ResponseEntityExceptionHandler extends Object
A convenient base class for @ControllerAdvice classes that wish to provide centralized exception handling across all @RequestMapping methods through @ExceptionHandler methods.

This base class provides an @ExceptionHandler method for handling internal Framework MVC exceptions. This method returns a ResponseEntity for writing to the response with a message converter, in contrast to SimpleHandlerExceptionHandler which returns a ModelAndView.

If there is no need to write error content to the response body, or when using view resolution (e.g., via ContentNegotiatingViewResolver), then DefaultHandlerExceptionHandler is good enough.

Note that in order for an @ControllerAdvice subclass to be detected, HandlerExceptionHandler must be configured.

从以下版本开始:
4.0 2022/3/2 18:12
作者:
Rossen Stoyanchev, Harry Yang
另请参阅: