| | |
| | | } |
| | | |
| | | /** |
| | | * 拦截捕捉自定义异常 PartyBuildingMemberException |
| | | * @param ex 党建异常 |
| | | * @return 异常信息 |
| | | */ |
| | | @ExceptionHandler(value = PartyBuildingMemberException.class) |
| | | public R PartyBuildingMemberException(PartyBuildingMemberException ex) { |
| | | return R.fail(ex.getMsg()); |
| | | } |
| | | |
| | | /** |
| | | * 拦截捕捉自定义异常 UnAuthenticationException.class |
| | | * @param ex 认证 异常 |
| | | * @return R 401 |
| | |
| | | |
| | | /** |
| | | * |
| | | * @param ex 数据库异常 |
| | | * @param ex 服务层业务异常 |
| | | * @return |
| | | */ |
| | | @ExceptionHandler(value = ServiceException.class) |
| | | public R serviceException(Exception ex) { |
| | | public R serviceException(ServiceException ex) { |
| | | log.error("服务层业务异常【{}】",ex.getMessage()); |
| | | return R.fail(ex.getMessage()); |
| | | } |