You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ce...@apache.org on 2022/08/01 12:48:45 UTC

[kafka] branch trunk updated: MINOR: Stop logging 404s at ERROR level in Connect

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

cegerton pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 31ff6d7f8a MINOR: Stop logging 404s at ERROR level in Connect
31ff6d7f8a is described below

commit 31ff6d7f8af57e8c39061f31774a61bd1728904e
Author: nicolasguyomar <ni...@gmail.com>
AuthorDate: Mon Aug 1 14:48:35 2022 +0200

    MINOR: Stop logging 404s at ERROR level in Connect
    
    Catches valid 404 exceptions, triggered by any HTTP request to a nonexistent path on the Connect REST API, higher in the code to not to log an ERROR log which can be seen as a false alarm
    
    Reviewers: Chris Egerton <fe...@gmail.com>
---
 .../kafka/connect/runtime/rest/errors/ConnectExceptionMapper.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/errors/ConnectExceptionMapper.java b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/errors/ConnectExceptionMapper.java
index 8678fbf16c..2bb90e2147 100644
--- a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/errors/ConnectExceptionMapper.java
+++ b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/errors/ConnectExceptionMapper.java
@@ -45,7 +45,7 @@ public class ConnectExceptionMapper implements ExceptionMapper<Exception> {
                     .build();
         }
 
-        if (exception instanceof NotFoundException) {
+        if (exception instanceof NotFoundException || exception instanceof javax.ws.rs.NotFoundException) {
             return Response.status(Response.Status.NOT_FOUND)
                     .entity(new ErrorMessage(Response.Status.NOT_FOUND.getStatusCode(), exception.getMessage()))
                     .build();