|
@@ -1,8 +1,10 @@
|
|
|
package com.fdkankan.fusion.exception;
|
|
|
|
|
|
+import com.fdkankan.fusion.common.ResultCode;
|
|
|
import com.fdkankan.fusion.exception.BusinessException;
|
|
|
import com.fdkankan.fusion.common.ResultData;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.tomcat.util.http.fileupload.impl.IOFileUploadException;
|
|
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|
@@ -33,4 +35,14 @@ public class GlobalExceptionHandler {
|
|
|
log.info("业务异常code:{},message:{}", e.getCode(), e.getMessage());
|
|
|
return ResultData.error(e.getCode(), e.getMessage());
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理未知异常
|
|
|
+ */
|
|
|
+ @ResponseBody
|
|
|
+ @ExceptionHandler(value = IOFileUploadException.class)
|
|
|
+ public ResultData iOFileUploadExceptionExceptionHandler(IOFileUploadException e) {
|
|
|
+ log.info("IOFileUploadException:", e);
|
|
|
+ return ResultData.error( ResultCode.USE_SPACE_ERROR);
|
|
|
+ }
|
|
|
}
|