|
|
@ -55,7 +55,6 @@ public class ControllerExceptionHandler { |
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
sb.append(fieldError.getField()).append("=[").append(fieldError.getRejectedValue()).append("]") |
|
|
|
.append(fieldError.getDefaultMessage()); |
|
|
|
e.printStackTrace(); |
|
|
|
log.error("BindException", e); |
|
|
|
return JsonResponse.newInstance().fail(-11,sb.toString()); |
|
|
|
} |
|
|
@ -63,7 +62,6 @@ public class ControllerExceptionHandler { |
|
|
|
@ExceptionHandler(value = HttpMessageNotReadableException.class) |
|
|
|
@ResponseBody |
|
|
|
public JsonResponse handleHttpMessageNotReadableException(HttpMessageNotReadableException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
log.error("HttpMessageNotReadableException", e); |
|
|
|
return JsonResponse.newInstance().fail(-12,e.getMessage()); |
|
|
|
} |
|
|
@ -71,8 +69,7 @@ public class ControllerExceptionHandler { |
|
|
|
@ExceptionHandler(value = BaseException.class) |
|
|
|
@ResponseBody |
|
|
|
public JsonResponse jsonBaseExceptionHandler(HttpServletRequest req, BaseException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
log.error("BaseException",e); |
|
|
|
log.info("BaseException,code:{},message:{}", e.getCode(), e.getMessage()); |
|
|
|
if (e.getCodeEnum() != null) { |
|
|
|
return JsonResponse.newInstance().ok(e.getCodeEnum()); |
|
|
|
} |
|
|
@ -82,7 +79,6 @@ public class ControllerExceptionHandler { |
|
|
|
@ExceptionHandler(value = Exception.class) |
|
|
|
@ResponseBody |
|
|
|
public JsonResponse jsonExceptionHandler(HttpServletRequest req, Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
log.error("Exception",e); |
|
|
|
return JsonResponse.newInstance().fail(-1,e.getMessage()); |
|
|
|
} |
|
|
|