@RestController @ControllerAdvice public class GlobalExceptionHandler extends Object
| 构造器和说明 |
|---|
GlobalExceptionHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
JsonResponse<Object> |
argumentExceptionHandler(javax.servlet.http.HttpServletRequest req,
Exception e)
BindException and MethodArgumentNotValidException handler
|
JsonResponse<Object> |
baseExceptionHandler(javax.servlet.http.HttpServletRequest req,
Exception e)
Base exception handler
|
JsonResponse<Object> |
defaultExceptionHandler(javax.servlet.http.HttpServletRequest req,
Exception e)
Default exception handler
|
@ExceptionHandler(value=top.lshaci.framework.common.exception.BaseException.class) public JsonResponse<Object> baseExceptionHandler(javax.servlet.http.HttpServletRequest req, Exception e)
req - the http servlet requeste - the exception@ExceptionHandler(value={org.springframework.validation.BindException.class,org.springframework.web.bind.MethodArgumentNotValidException.class})
public JsonResponse<Object> argumentExceptionHandler(javax.servlet.http.HttpServletRequest req,
Exception e)
req - the http servlet requeste - the exception@ExceptionHandler(value=java.lang.Exception.class) public JsonResponse<Object> defaultExceptionHandler(javax.servlet.http.HttpServletRequest req, Exception e)
req - the http servlet requeste - the exceptionCopyright © 2019. All rights reserved.