diff --git a/src/main/java/eu/dnetlib/uoaauthorizationlibrary/authorization/exceptions/ExceptionsHandler.java b/src/main/java/eu/dnetlib/uoaauthorizationlibrary/authorization/exceptions/ExceptionsHandler.java index da06669..4f9c4dc 100644 --- a/src/main/java/eu/dnetlib/uoaauthorizationlibrary/authorization/exceptions/ExceptionsHandler.java +++ b/src/main/java/eu/dnetlib/uoaauthorizationlibrary/authorization/exceptions/ExceptionsHandler.java @@ -24,8 +24,8 @@ public class ExceptionsHandler { return new ResponseEntity<>(new ExceptionResponse(ex, ex.getHttpStatus()), ex.getHttpStatus()); } - @ExceptionHandler(Exception.class) - public ResponseEntity exception(Exception ex) { + @ExceptionHandler(RuntimeException.class) + public ResponseEntity exception(RuntimeException ex) { log.error(ex.getMessage(), ex); return new ResponseEntity<>(new ExceptionResponse(ex, HttpStatus.BAD_REQUEST), HttpStatus.BAD_REQUEST); }