Introduce log statement, to log stacktrace for MultipartExceptions with root cause without a message (#733)

Signed-off-by: Jeroen Laverman <jeroen.laverman@bosch-si.com>
This commit is contained in:
Jeroen Laverman
2018-09-13 15:52:47 +02:00
committed by Dominic Schabel
parent 3eafb29064
commit 16ce2503df

View File

@@ -200,6 +200,12 @@ public class ResponseExceptionHandler {
final List<Throwable> throwables = ExceptionUtils.getThrowableList(ex);
final Throwable responseCause = Iterables.getLast(throwables);
if (responseCause.getMessage().isEmpty()) {
LOG.warn("Request {} lead to MultipartException without root cause message:\n{}", request.getRequestURL(),
ex.getStackTrace());
}
final ExceptionInfo response = createExceptionInfo(new MultiPartFileUploadException(responseCause));
return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST);
}