Polish serialization/deserialization exception logging

This commit introduces the following changes in AbstractHandlerExceptionResolver:
 - warnLogger used to log exception is enabled by default
 - the exception message is now logged instead of the whole exception stacktrace
 - warn logging is only performed if doResolveException() returns a non-null
   ModelAndView, in order to avoid logging multiple times the error

Issue: SPR-13100
This commit is contained in:
Sebastien Deleuze
2015-06-16 10:27:52 +02:00
parent ce7cc79e9f
commit a08c9f3137
2 changed files with 20 additions and 15 deletions

View File

@@ -56,6 +56,7 @@ import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMeth
import org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver;
import static org.junit.Assert.*;
import org.mockito.Mockito;
/**
* Test fixture for {@link ResponseEntityExceptionHandler}.
@@ -179,7 +180,7 @@ public class ResponseEntityExceptionHandlerTests {
@Test
public void methodArgumentNotValid() {
Exception ex = new MethodArgumentNotValidException(null, null);
Exception ex = Mockito.mock(MethodArgumentNotValidException.class);
testException(ex);
}