RED-4029 - Do not log on ERROR level if something happens that is expected

- put back null pointer exception to error logging
This commit is contained in:
devplant 2022-06-07 11:39:55 +03:00
parent f6b4d2a067
commit fa3cbc938c

View File

@ -23,10 +23,10 @@ public class ControllerAdvice {
@ExceptionHandler(value = NullPointerException.class)
public ErrorMessage handleContentNotFoundException(NullPointerException e) {
if (e != null) {
log.debug(e.getMessage(), e);
log.error(e.getMessage(), e);
return new ErrorMessage(OffsetDateTime.now(), e.getMessage());
}
log.debug("Nullpointer exception at ", e);
log.error("Nullpointer exception at ", e);
return new ErrorMessage(OffsetDateTime.now(), "Nullpointer exception");
}