| | |
| | | package com.xcong.excoin.configurations; |
| | | |
| | | import com.xcong.excoin.common.exception.GlobalException; |
| | | import com.xcong.excoin.common.response.Result; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.dao.DuplicateKeyException; |
| | |
| | | return null; |
| | | } |
| | | |
| | | @ExceptionHandler(value = {Exception.class}) |
| | | public Result handleException(Exception e) { |
| | | log.error(e.getMessage(), e); |
| | | return Result.fail("系统异常"); |
| | | } |
| | | |
| | | /** |
| | | * spring security 账户密码验证异常 |
| | |
| | | return Result.fail("用户名或密码错误"); |
| | | } |
| | | |
| | | @ExceptionHandler(value = {GlobalException.class}) |
| | | public Result handleException(GlobalException e) { |
| | | return Result.fail(e.getMessage()); |
| | | } |
| | | |
| | | @ExceptionHandler(value = {Exception.class}) |
| | | public Result handleException(Exception e) { |
| | | log.error(e.getMessage(), e); |
| | | return Result.fail("系统异常"); |
| | | } |
| | | |
| | | } |