@RestControllerAdvice public class GlobalExceptionHandler extends Object
| 构造器和说明 |
|---|
GlobalExceptionHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
Result |
authenticationException(org.springframework.security.core.AuthenticationException exception,
javax.servlet.http.HttpServletRequest request) |
Result |
bindException(org.springframework.validation.BindException exception,
javax.servlet.http.HttpServletRequest request) |
Result |
dbDataIntegrityViolationException(org.springframework.dao.DataIntegrityViolationException exception,
javax.servlet.http.HttpServletRequest request) |
Result |
dbDuplicateKeyException(org.springframework.dao.DuplicateKeyException exception,
javax.servlet.http.HttpServletRequest request) |
Result |
dbViolationException(SQLIntegrityConstraintViolationException exception,
javax.servlet.http.HttpServletRequest request) |
Result |
illegalArgumentException(IllegalArgumentException exception,
javax.servlet.http.HttpServletRequest request) |
Result |
methodArgumentNotValidException(org.springframework.web.bind.MethodArgumentNotValidException exception,
javax.servlet.http.HttpServletRequest request) |
Result |
otherException(Exception exception,
javax.servlet.http.HttpServletRequest request) |
Result |
persistenceException(org.apache.ibatis.exceptions.PersistenceException exception,
javax.servlet.http.HttpServletRequest request) |
@ExceptionHandler(value=java.lang.IllegalArgumentException.class) @ResponseStatus(value=BAD_REQUEST) public Result illegalArgumentException(IllegalArgumentException exception, javax.servlet.http.HttpServletRequest request)
@ExceptionHandler(value=org.springframework.validation.BindException.class) @ResponseStatus(value=BAD_REQUEST) public Result bindException(org.springframework.validation.BindException exception, javax.servlet.http.HttpServletRequest request)
@ExceptionHandler(value=org.springframework.dao.DataIntegrityViolationException.class) @ResponseStatus(value=BAD_REQUEST) public Result dbDataIntegrityViolationException(org.springframework.dao.DataIntegrityViolationException exception, javax.servlet.http.HttpServletRequest request)
@ExceptionHandler(value=java.sql.SQLIntegrityConstraintViolationException.class) @ResponseStatus(value=BAD_REQUEST) public Result dbViolationException(SQLIntegrityConstraintViolationException exception, javax.servlet.http.HttpServletRequest request)
@ExceptionHandler(value=org.springframework.dao.DuplicateKeyException.class) @ResponseStatus(value=BAD_REQUEST) public Result dbDuplicateKeyException(org.springframework.dao.DuplicateKeyException exception, javax.servlet.http.HttpServletRequest request)
@ExceptionHandler(value=org.springframework.web.bind.MethodArgumentNotValidException.class) @ResponseStatus(value=BAD_REQUEST) public Result methodArgumentNotValidException(org.springframework.web.bind.MethodArgumentNotValidException exception, javax.servlet.http.HttpServletRequest request)
@ExceptionHandler(value=org.apache.ibatis.exceptions.PersistenceException.class) @ResponseStatus(value=INTERNAL_SERVER_ERROR) public Result persistenceException(org.apache.ibatis.exceptions.PersistenceException exception, javax.servlet.http.HttpServletRequest request)
@ExceptionHandler(value=org.springframework.security.core.AuthenticationException.class) @ResponseStatus(value=INTERNAL_SERVER_ERROR) public Result authenticationException(org.springframework.security.core.AuthenticationException exception, javax.servlet.http.HttpServletRequest request)
@ExceptionHandler(value=java.lang.Exception.class) @ResponseStatus(value=INTERNAL_SERVER_ERROR) public Result otherException(Exception exception, javax.servlet.http.HttpServletRequest request)
Copyright © 2020. All rights reserved.