Work around Framework regression in handling of null model values

See https://github.com/spring-projects/spring-framework/issues/23038.
pull/16984/head
Andy Wilkinson 6 years ago
parent d21a091262
commit 892e517c21

@ -91,7 +91,8 @@ public class DefaultErrorAttributes implements ErrorAttributes {
HttpStatus errorStatus = determineHttpStatus(error, responseStatusAnnotation); HttpStatus errorStatus = determineHttpStatus(error, responseStatusAnnotation);
errorAttributes.put("status", errorStatus.value()); errorAttributes.put("status", errorStatus.value());
errorAttributes.put("error", errorStatus.getReasonPhrase()); 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()); errorAttributes.put("requestId", request.exchange().getRequest().getId());
handleException(errorAttributes, determineException(error), includeStackTrace); handleException(errorAttributes, determineException(error), includeStackTrace);
return errorAttributes; return errorAttributes;

Loading…
Cancel
Save