|
@@ -2,6 +2,7 @@ package cn.kdan.pdf.backend.core.config;
|
|
|
|
|
|
import constant.CommonConstant;
|
|
import constant.CommonConstant;
|
|
import exception.BackendRuntimeException;
|
|
import exception.BackendRuntimeException;
|
|
|
|
+import exception.TooManyDeviceException;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.context.support.DefaultMessageSourceResolvable;
|
|
import org.springframework.context.support.DefaultMessageSourceResolvable;
|
|
@@ -42,6 +43,12 @@ public class ControllerExceptionHandler {
|
|
return new ResultMap<>(CommonConstant.EXCEPTION_CODE_RUNTIME_ERROR, e.getMessage());
|
|
return new ResultMap<>(CommonConstant.EXCEPTION_CODE_RUNTIME_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ExceptionHandler(TooManyDeviceException.class)
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public ResultMap<?> handlerDevOpsTooManyDeviceException(TooManyDeviceException e) {
|
|
|
|
+ return new ResultMap<>(CommonConstant.EXCEPTION_CODE_TOO_MANY_DEVICE_ERROR, e.getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
@ExceptionHandler(ConstraintViolationException.class)
|
|
@ExceptionHandler(ConstraintViolationException.class)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public ResultMap<?> handlerConstraintViolationException(ConstraintViolationException e) {
|
|
public ResultMap<?> handlerConstraintViolationException(ConstraintViolationException e) {
|