| | |
| | | package com.vincent.rsf.server.common.exception; |
| | | |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.constant.Constants; |
| | | import com.vincent.rsf.server.common.utils.CommonUtil; |
| | | import org.slf4j.Logger; |
| | |
| | | @ExceptionHandler(BusinessException.class) |
| | | public R businessExceptionHandler(BusinessException e, HttpServletResponse response) { |
| | | CommonUtil.addCrossHeaders(response); |
| | | return R.parse(e.getMessage()); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @ExceptionHandler(CoolException.class) |
| | | public R coolExceptionHandler(CoolException e, HttpServletResponse response) { |
| | | CommonUtil.addCrossHeaders(response); |
| | | return R.error(e.getMessage()); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @ExceptionHandler(Throwable.class) |
| | | public R exceptionHandler(Throwable e, HttpServletResponse response) { |