diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/HttpFSExceptionProvider.java b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/HttpFSExceptionProvider.java index aed63431234..e0b98c635fc 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/HttpFSExceptionProvider.java +++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/HttpFSExceptionProvider.java @@ -70,12 +70,16 @@ public class HttpFSExceptionProvider extends ExceptionProvider { status = Response.Status.NOT_FOUND; } else if (throwable instanceof IOException) { status = Response.Status.INTERNAL_SERVER_ERROR; + logErrorFully(status, throwable); } else if (throwable instanceof UnsupportedOperationException) { status = Response.Status.BAD_REQUEST; + logErrorFully(status, throwable); } else if (throwable instanceof IllegalArgumentException) { status = Response.Status.BAD_REQUEST; + logErrorFully(status, throwable); } else { status = Response.Status.INTERNAL_SERVER_ERROR; + logErrorFully(status, throwable); } return createResponse(status, throwable); } @@ -95,4 +99,7 @@ public class HttpFSExceptionProvider extends ExceptionProvider { LOG.warn("[{}:{}] response [{}] {}", new Object[]{method, path, status, message}, throwable); } + private void logErrorFully(Response.Status status, Throwable throwable) { + LOG.debug("Failed with {}", status, throwable); + } }