@ControllerAdvice
public class GlobalControllerExceptionHandler
extends org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
| 构造器和说明 |
|---|
GlobalControllerExceptionHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected org.springframework.http.ResponseEntity<Object> |
handleExceptionInternal(Exception ex,
Object body,
org.springframework.http.HttpHeaders headers,
org.springframework.http.HttpStatus status,
org.springframework.web.context.request.WebRequest request)
A single place to customize the response body of all exception types.
|
handleAsyncRequestTimeoutException, handleBindException, handleConversionNotSupported, handleException, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotReadable, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMethodArgumentNotValid, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleServletRequestBindingException, handleTypeMismatchprotected org.springframework.http.ResponseEntity<Object> handleExceptionInternal(Exception ex, Object body, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.context.request.WebRequest request)
The default implementation sets the WebUtils.ERROR_EXCEPTION_ATTRIBUTE
request attribute and creates a ResponseEntity from the given
body, headers, and status.
handleExceptionInternal 在类中 org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandlerex - the exceptionbody - the body for the responseheaders - the headers for the responsestatus - the response statusrequest - the current requestCopyright © 2021. All rights reserved.