@RestControllerAdvice
public class GlobalExceptionHandler
extends org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
| 构造器和说明 |
|---|
GlobalExceptionHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
IRestResponse<?> |
authorityExceptionHandler(AuthorityException exception) |
IRestResponse<?> |
exceptionHandler(Exception exception) |
protected org.springframework.http.ResponseEntity<Object> |
handleMethodArgumentNotValid(org.springframework.web.bind.MethodArgumentNotValidException exception,
org.springframework.http.HttpHeaders headers,
org.springframework.http.HttpStatus status,
org.springframework.web.context.request.WebRequest request)
Customize the response for MethodArgumentNotValidException.
|
handleAsyncRequestTimeoutException, handleBindException, handleConversionNotSupported, handleException, handleExceptionInternal, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotReadable, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleServletRequestBindingException, handleTypeMismatch@ResponseStatus(value=OK) @ExceptionHandler(value=java.lang.Exception.class) @ResponseBody public IRestResponse<?> exceptionHandler(Exception exception)
@ResponseStatus(value=UNAUTHORIZED) @ExceptionHandler(value=AuthorityException.class) @ResponseBody public IRestResponse<?> authorityExceptionHandler(AuthorityException exception)
protected org.springframework.http.ResponseEntity<Object> handleMethodArgumentNotValid(org.springframework.web.bind.MethodArgumentNotValidException exception, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.context.request.WebRequest request)
This method delegates to ResponseEntityExceptionHandler.handleExceptionInternal(java.lang.Exception, java.lang.Object, org.springframework.http.HttpHeaders, org.springframework.http.HttpStatus, org.springframework.web.context.request.WebRequest).
handleMethodArgumentNotValid 在类中 org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandlerexception - the exceptionheaders - the headers to be written to the responsestatus - the selected response statusrequest - the current requestResponseEntity instanceCopyright © 2021. All rights reserved.