|
|
@@ -25,12 +25,14 @@ public class GlobalSystemExceptionHandler {
|
|
|
@ExceptionHandler(value = SystemException.class)
|
|
|
@ResponseBody
|
|
|
public HttpResult handlerSystemException(SystemException e) {
|
|
|
+ log.error("业务异常:", e);
|
|
|
return HttpResult.error(e.getCode(), e.getMessage());
|
|
|
}
|
|
|
|
|
|
@ExceptionHandler(value = RuntimeException.class)
|
|
|
@ResponseBody
|
|
|
public HttpResult handlerRuntimeException(RuntimeException e) {
|
|
|
+ log.error("业务异常:", e);
|
|
|
return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
|
|
|
}
|
|
|
|
|
|
@@ -43,7 +45,7 @@ public class GlobalSystemExceptionHandler {
|
|
|
@ResponseBody
|
|
|
@ExceptionHandler(BusinessException.class)
|
|
|
public HttpResult businessExceptionHandler(BusinessException ex) {
|
|
|
- log.info("业务异常,message={},param={}", ex.getMsg(), ex.getParam());
|
|
|
+ log.error("业务异常,message={},param={}", ex.getMsg(), ex.getParam());
|
|
|
return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, ex.getMessage());
|
|
|
}
|
|
|
|
|
|
@@ -56,7 +58,7 @@ public class GlobalSystemExceptionHandler {
|
|
|
@ResponseBody
|
|
|
@ExceptionHandler(CustomPromptException.class)
|
|
|
public HttpResult customPromptExceptionHandler(CustomPromptException ex) {
|
|
|
- log.info("前端自定义提示异常,code={},message={},param={}", ex.getCode(), ex.getMsg(), ex.getParam());
|
|
|
+ log.error("前端自定义提示异常,code={},message={},param={}", ex.getCode(), ex.getMsg(), ex.getParam());
|
|
|
return HttpResult.error(ex.getCode(), ex.getMessage());
|
|
|
}
|
|
|
|
|
|
@@ -70,7 +72,7 @@ public class GlobalSystemExceptionHandler {
|
|
|
@ResponseBody
|
|
|
@ExceptionHandler(NotLoginException.class)
|
|
|
public HttpResult notLoginException(NotLoginException ex) {
|
|
|
- log.info("用户未登录, message={}, param={}", ex.getMsg(), ex.getParam());
|
|
|
+ log.error("用户未登录, message={}, param={}", ex.getMsg(), ex.getParam());
|
|
|
return HttpResult.error(HttpStatus.UN_LOGIN_CODE, HttpStatus.UN_LOGIN_MESSAGE, ex.getMessage());
|
|
|
}
|
|
|
|
|
|
@@ -103,14 +105,14 @@ public class GlobalSystemExceptionHandler {
|
|
|
}
|
|
|
}
|
|
|
String errMsg = sb.toString();
|
|
|
- log.info("参数校验异常:{}", errMsg);
|
|
|
+ log.error("参数校验异常:{}", errMsg);
|
|
|
return HttpResult.error(HttpStatus.PARAMETERS_PATTERN_ERROR_CODE, errMsg);
|
|
|
}
|
|
|
|
|
|
@ResponseBody
|
|
|
@ExceptionHandler(ConstraintViolationException.class)
|
|
|
public HttpResult constraintViolationExceptionHandler(ConstraintViolationException ex) {
|
|
|
- log.info("参数校验异常c:{}", ex.getMessage());
|
|
|
+ log.error("参数校验异常c:{}", ex.getMessage());
|
|
|
Set<ConstraintViolation<?>> constraintViolations = ex.getConstraintViolations();
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
if (!CollectionUtils.isEmpty(constraintViolations)) {
|