Pull request #404: RED-4029 - Do not log on ERROR level if something happens that is expected

Merge in RED/redaction-service from RED_4029_1 to master

* commit 'fa3cbc938c6d5066b4c6706bc0c98ac030f4c498':
  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:
Corina Olariu 2022-06-07 10:49:18 +02:00 committed by Timo Bejan
commit 6fec4cc209

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");
}