Skip to content

Commit

Permalink
Log spring errors in the console
Browse files Browse the repository at this point in the history
  • Loading branch information
Slimane AMAR committed Apr 5, 2024
1 parent 93ef9ad commit fb450d6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ protected ResponseEntity<Object> handleExploreException(ExploreException excepti

@ExceptionHandler(value = {Exception.class})
protected ResponseEntity<Object> handleAllException(Exception exception) {
if (LOGGER.isErrorEnabled()) {
LOGGER.error(exception.getMessage(), exception);
}
if (exception instanceof HttpStatusCodeException) {
return ResponseEntity.status(((HttpStatusCodeException) exception).getStatusCode()).body(exception.getMessage());
} else {
Expand Down

0 comments on commit fb450d6

Please sign in to comment.