|
@@ -1,6 +1,7 @@
|
|
|
package com.dgtly.apiframework.exception;
|
|
package com.dgtly.apiframework.exception;
|
|
|
|
|
|
|
|
import com.dgtly.common.core.domain.AjaxResult;
|
|
import com.dgtly.common.core.domain.AjaxResult;
|
|
|
|
|
+import com.dgtly.common.core.domain.ResultType;
|
|
|
import com.dgtly.common.exception.BusinessException;
|
|
import com.dgtly.common.exception.BusinessException;
|
|
|
import com.dgtly.common.exception.DemoModeException;
|
|
import com.dgtly.common.exception.DemoModeException;
|
|
|
import com.dgtly.common.utils.ServletUtils;
|
|
import com.dgtly.common.utils.ServletUtils;
|
|
@@ -36,7 +37,15 @@ public class ApiGlobalExceptionHandler
|
|
|
log.error(e.getMessage(), e);
|
|
log.error(e.getMessage(), e);
|
|
|
return AjaxResult.error("不支持' " + e.getMethod() + "'请求");
|
|
return AjaxResult.error("不支持' " + e.getMethod() + "'请求");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 系统异常
|
|
|
|
|
+ */
|
|
|
|
|
+ @ExceptionHandler(LessParamException.class)
|
|
|
|
|
+ public AjaxResult handleException(LessParamException e)
|
|
|
|
|
+ {
|
|
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
|
|
+ return AjaxResult.error(ResultType.LESSPARAM);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 拦截未知的运行时异常
|
|
* 拦截未知的运行时异常
|