|
@@ -66,6 +66,15 @@ public class GlobalExceptionHandler {
|
|
// return ResultData.error(ServerCode.SYSTEM_ERROR.code(), "系统繁忙,请稍后重试");
|
|
// return ResultData.error(ServerCode.SYSTEM_ERROR.code(), "系统繁忙,请稍后重试");
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * <p>
|
|
|
|
+ form表达提交,缺少参数异常处理
|
|
|
|
+ * </p>
|
|
|
|
+ * @author dengsixing
|
|
|
|
+ * @date 2022/4/14
|
|
|
|
+ * @param e
|
|
|
|
+ * @return com.fdkankan.common.response.ResultData
|
|
|
|
+ **/
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@ExceptionHandler(value = MissingServletRequestParameterException.class)
|
|
@ExceptionHandler(value = MissingServletRequestParameterException.class)
|
|
public ResultData missingServletRequestParameterException(
|
|
public ResultData missingServletRequestParameterException(
|
|
@@ -75,6 +84,15 @@ public class GlobalExceptionHandler {
|
|
ServerCode.PARAM_REQUIRED.formatMessage(e.getParameterName()));
|
|
ServerCode.PARAM_REQUIRED.formatMessage(e.getParameterName()));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * <p>
|
|
|
|
+ form表达提交,文件为空异常处理
|
|
|
|
+ * </p>
|
|
|
|
+ * @author dengsixing
|
|
|
|
+ * @date 2022/4/14
|
|
|
|
+ * @param e
|
|
|
|
+ * @return com.fdkankan.common.response.ResultData
|
|
|
|
+ **/
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@ExceptionHandler(value = MultipartException.class)
|
|
@ExceptionHandler(value = MultipartException.class)
|
|
public ResultData multipartException(MultipartException e){
|
|
public ResultData multipartException(MultipartException e){
|
|
@@ -85,7 +103,7 @@ public class GlobalExceptionHandler {
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 校验错误拦截处理
|
|
|
|
|
|
+ * 参数校验异常拦截处理
|
|
*/
|
|
*/
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@ExceptionHandler({BindException.class,MethodArgumentNotValidException.class})
|
|
@ExceptionHandler({BindException.class,MethodArgumentNotValidException.class})
|
|
@@ -111,7 +129,7 @@ public class GlobalExceptionHandler {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return ResultData.error(ErrorCode.PARAM_FORMAT_ERROR.code(), message);
|
|
|
|
|
|
+ return ResultData.error(ErrorCode.PARAM_REQUIRED.code(), message);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|