From 78baf6497a5d0ce499b6d9676300c2fd8be151f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 29 Sep 2025 13:35:10 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E6=8B=A6?= =?UTF-8?q?=E6=88=AAsse=E8=B6=85=E6=97=B6=E5=BC=82=E5=B8=B8=20=E4=B8=8D?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E9=A2=9D=E5=A4=96=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/web/handler/GlobalExceptionHandler.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java b/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java index 28aacbcfb..3d1aac22a 100644 --- a/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java +++ b/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java @@ -23,6 +23,7 @@ import org.springframework.web.bind.MissingPathVariableException; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.context.request.async.AsyncRequestTimeoutException; import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; import org.springframework.web.servlet.NoHandlerFoundException; @@ -123,7 +124,7 @@ public class GlobalExceptionHandler { */ @ResponseStatus(org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR) @ExceptionHandler(IOException.class) - public void handleRuntimeException(IOException e, HttpServletRequest request) { + public void handleIoException(IOException e, HttpServletRequest request) { String requestURI = request.getRequestURI(); if (requestURI.contains("sse")) { // sse 经常性连接中断 例如关闭浏览器 直接屏蔽 @@ -132,6 +133,13 @@ public class GlobalExceptionHandler { log.error("请求地址'{}',连接中断", requestURI, e); } + /** + * sse 连接超时异常 不需要处理 + */ + @ExceptionHandler(AsyncRequestTimeoutException.class) + public void handleRuntimeException(AsyncRequestTimeoutException e) { + } + /** * 拦截未知的运行时异常 */