Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,16 @@ public Response toResponse(Throwable throwable) {
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);
}
Expand All @@ -95,4 +99,7 @@ protected void log(Response.Status status, Throwable throwable) {
LOG.warn("[{}:{}] response [{}] {}", method, path, status, message, throwable);
}

private void logErrorFully(Response.Status status, Throwable throwable) {
LOG.debug("Failed with {}", status, throwable);
}
}