Skip to content

Commit

Permalink
Log spring errors in the console (#82)
Browse files Browse the repository at this point in the history
Co-authored-by: Slimane AMAR <[email protected]>
  • Loading branch information
SlimaneAmar and Slimane AMAR authored Apr 11, 2024
1 parent d33f100 commit 6f16462
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 6f16462

Please sign in to comment.