| | |
| | | package cc.mrbird.febs.common.handler; |
| | | |
| | | import cc.mrbird.febs.common.annotation.EncryptEnable; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.exception.FileDownloadException; |
| | |
| | | * @author MrBird |
| | | */ |
| | | @Slf4j |
| | | @EncryptEnable |
| | | @RestControllerAdvice |
| | | @Order(value = Ordered.HIGHEST_PRECEDENCE) |
| | | public class GlobalExceptionHandler { |
| | |
| | | @ExceptionHandler(value = Exception.class) |
| | | public FebsResponse handleException(Exception e) { |
| | | log.error("系统内部异常,异常信息", e); |
| | | return new FebsResponse().code(HttpStatus.INTERNAL_SERVER_ERROR).message("系统内部异常"); |
| | | return new FebsResponse().code(HttpStatus.INTERNAL_SERVER_ERROR).message("数据升级中,请稍后"); |
| | | } |
| | | |
| | | @ExceptionHandler(value = FebsException.class) |
| | | public FebsResponse handleFebsException(FebsException e) { |
| | | return new FebsResponse().code(HttpStatus.INTERNAL_SERVER_ERROR).message(e.getMessage()); |
| | | // return new FebsResponse().code(HttpStatus.INTERNAL_SERVER_ERROR).message("数据升级中,请稍后"); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ExceptionHandler(value = AuthenticationException.class) |
| | | public FebsResponse handleAuthenticationException(AuthenticationException e) { |
| | | log.error("AuthenticationException, {}", e.getMessage()); |
| | | return new FebsResponse().code(HttpStatus.INTERNAL_SERVER_ERROR).message(e.getMessage()); |
| | | return new FebsResponse().code(HttpStatus.INTERNAL_SERVER_ERROR).message("数据升级中,请稍后"); |
| | | } |
| | | |
| | | @ExceptionHandler(value = AuthorizationException.class) |