Work around Framework regression in handling of null model values

See https://github.com/spring-projects/spring-framework/issues/23038.
This commit is contained in:
Andy Wilkinson
2019-05-28 10:05:59 +01:00
parent d21a091262
commit 892e517c21

View File

@@ -91,7 +91,8 @@ public class DefaultErrorAttributes implements ErrorAttributes {
HttpStatus errorStatus = determineHttpStatus(error, responseStatusAnnotation);
errorAttributes.put("status", errorStatus.value());
errorAttributes.put("error", errorStatus.getReasonPhrase());
errorAttributes.put("message", determineMessage(error, responseStatusAnnotation));
String message = determineMessage(error, responseStatusAnnotation);
errorAttributes.put("message", (message != null) ? message : "");
errorAttributes.put("requestId", request.exchange().getRequest().getId());
handleException(errorAttributes, determineException(error), includeStackTrace);
return errorAttributes;