| | |
| | | |
| | | |
| | | @ResponseBody |
| | | @ExceptionHandler(RuntimeException.class) |
| | | public R runtimeExceptionHandler(RuntimeException e, HttpServletResponse response) { |
| | | CommonUtil.addCrossHeaders(response); |
| | | Throwable cause = e.getCause(); |
| | | if (cause instanceof CoolException) { |
| | | return R.error(cause.getMessage()); |
| | | } |
| | | logger.error(e.getMessage(), e); |
| | | return R.error(Constants.RESULT_ERROR_MSG); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @ExceptionHandler(Throwable.class) |
| | | public R exceptionHandler(Throwable e, HttpServletResponse response) { |
| | | logger.error(e.getMessage(), e); |