|
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|
|
import org.springframework.web.servlet.NoHandlerFoundException;
|
|
|
|
|
|
import javax.validation.ConstraintViolationException;
|
|
|
+import java.io.IOException;
|
|
|
|
|
|
/**
|
|
|
* 全局异常处理器
|
|
@@ -85,6 +86,10 @@ public class GlobalExceptionHandler {
|
|
|
@ExceptionHandler(Exception.class)
|
|
|
public Result handleException(Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
+ if (e instanceof IOException) {
|
|
|
+ log.error("操作异常: IO异常, 暂时不处理; 异常信息: {}", e.getMessage());
|
|
|
+ return Result.error(501, "操作异常: IO异常, 暂时不处理!");
|
|
|
+ }
|
|
|
return Result.error();
|
|
|
}
|
|
|
|