This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


The following commit(s) were added to refs/heads/master by this push:
     new f6eb81fa50 [FIX] Silent Eof exception for webadmin (#2577)
f6eb81fa50 is described below

commit f6eb81fa50ab4ada5d756465d579c949732a307d
Author: Benoit TELLIER <btell...@linagora.com>
AuthorDate: Mon Dec 23 23:05:19 2024 +0100

    [FIX] Silent Eof exception for webadmin (#2577)
    
    Cancellation generated by curl ... | head is very
    verbose and needlessly noisy.
---
 .../src/main/java/org/apache/james/webadmin/WebAdminServer.java       | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/server/protocols/webadmin/webadmin-core/src/main/java/org/apache/james/webadmin/WebAdminServer.java
 
b/server/protocols/webadmin/webadmin-core/src/main/java/org/apache/james/webadmin/WebAdminServer.java
index ccac999d69..2fd02a7126 100644
--- 
a/server/protocols/webadmin/webadmin-core/src/main/java/org/apache/james/webadmin/WebAdminServer.java
+++ 
b/server/protocols/webadmin/webadmin-core/src/main/java/org/apache/james/webadmin/WebAdminServer.java
@@ -49,6 +49,7 @@ import org.apache.james.webadmin.metric.MetricPreFilter;
 import org.apache.james.webadmin.routes.CORSRoute;
 import org.apache.james.webadmin.utils.ErrorResponder;
 import org.apache.james.webadmin.utils.JsonExtractException;
+import org.eclipse.jetty.io.EofException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -187,6 +188,7 @@ public class WebAdminServer implements Startable {
             .asString());
 
         service.exception(JsonExtractException.class, (ex, req, res) -> {
+            LOGGER.info("Invalid JSON body supplied in the user request", ex);
             res.status(BAD_REQUEST_400);
             res.body(ErrorResponder.builder()
                 .statusCode(BAD_REQUEST_400)
@@ -196,6 +198,8 @@ public class WebAdminServer implements Startable {
                 .asString());
         });
 
+        service.exception(EofException.class, (ex, req, res) -> 
LOGGER.info("Transfer aborted by the client"));
+
         service.exception(IllegalArgumentException.class, (ex, req, res) -> {
             LOGGER.info("Invalid arguments supplied in the user request", ex);
             res.status(BAD_REQUEST_400);


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org

Reply via email to