From 5cf3c20ed4463c6f35d51fc4e10366fe2b850f29 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 2 Nov 2018 16:17:37 +0300 Subject: SSE: move timeout exceptions to debug level --- juick-server/src/main/java/com/juick/server/api/Service.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'juick-server/src/main/java/com/juick/server/api') diff --git a/juick-server/src/main/java/com/juick/server/api/Service.java b/juick-server/src/main/java/com/juick/server/api/Service.java index f38078d5..ed62886f 100644 --- a/juick-server/src/main/java/com/juick/server/api/Service.java +++ b/juick-server/src/main/java/com/juick/server/api/Service.java @@ -19,9 +19,11 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.context.request.async.AsyncRequestTimeoutException; import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; import springfox.documentation.annotations.ApiIgnore; @@ -157,4 +159,8 @@ public class Service { return emitter; } + @ExceptionHandler(AsyncRequestTimeoutException.class) + public void eventErrorHandler(Exception ex) { + logger.debug("SSE timeout", ex); + } } -- cgit v1.2.3