Skip to content

Commit

Permalink
Reduce the logging level of the "normal" errors.
Browse files Browse the repository at this point in the history
It's expected that request will be made that are missing parameters and are made for invalid registration IDs. So they are errors, but they aren't a proper internal error that needs investigating like other exceptions.
  • Loading branch information
buckett committed Nov 23, 2023
1 parent 4f9d542 commit 4ce14f7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,14 @@ private boolean hasNoPlatform(HttpServletRequest request) {
private void unsuccessfulRedirectForAuthorization(HttpServletRequest request, HttpServletResponse response,
Exception failed) throws IOException, ServletException {

if (logger.isErrorEnabled()) {
logger.error("Authorization Request failed: " + failed.toString(), failed);
}
if (failed instanceof InvalidInitiationRequestException) {
logger.info("Invalid initiation request: "+ failed);
response.sendError(HttpStatus.BAD_REQUEST.value(), failed.getMessage());
} else if (failed instanceof InvalidClientRegistrationIdException) {
logger.info("Invalid registration ID: "+ failed);
response.sendError(HttpStatus.NOT_FOUND.value(), failed.getMessage());
} else {
logger.error("Authorization Request failed: " + failed.toString(), failed);
response.sendError(HttpStatus.INTERNAL_SERVER_ERROR.value(), HttpStatus.INTERNAL_SERVER_ERROR.getReasonPhrase());
}
}
Expand Down

0 comments on commit 4ce14f7

Please sign in to comment.