Commit 8664e7d7 by 吴迪

【修改】异常处理

parent 67b55c69
...@@ -52,9 +52,21 @@ public class RRExceptionHandler { ...@@ -52,9 +52,21 @@ public class RRExceptionHandler {
return R.error("没有权限,请联系管理员授权"); return R.error("没有权限,请联系管理员授权");
} }
@ExceptionHandler(IllegalArgumentException.class)
public R handleIllegalArgumentException(IllegalArgumentException e){
logger.error(e.getMessage(), e);
return R.error();
}
@ExceptionHandler(Exception.class) @ExceptionHandler(Exception.class)
public R handleException(Exception e){ public R handleException(Exception e){
logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);
return R.error(); return R.error();
} }
@ExceptionHandler(IllegalArgumentException.class)
public R handleException(IllegalArgumentException e){
logger.error(e.getMessage(), e);
return R.error();
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment