Fix include exception handling in DefaultErrorAttributes

This commit fixes a problem with the handling of the includeException
field in DefaultErrorAttributes.

See gh-22750
pull/23585/head
Lopfest 4 years ago committed by Scott Frederick
parent d452bbbea8
commit c49605cd7b

@ -86,7 +86,7 @@ public class DefaultErrorAttributes implements ErrorAttributes {
@Override
public Map<String, Object> getErrorAttributes(ServerRequest request, ErrorAttributeOptions options) {
Map<String, Object> errorAttributes = getErrorAttributes(request, options.isIncluded(Include.STACK_TRACE));
if (this.includeException != null) {
if (Boolean.TRUE.equals(this.includeException)) {
options = options.including(Include.EXCEPTION);
}
if (!options.isIncluded(Include.EXCEPTION)) {

@ -108,7 +108,7 @@ public class DefaultErrorAttributes implements ErrorAttributes, HandlerException
@Override
public Map<String, Object> getErrorAttributes(WebRequest webRequest, ErrorAttributeOptions options) {
Map<String, Object> errorAttributes = getErrorAttributes(webRequest, options.isIncluded(Include.STACK_TRACE));
if (this.includeException != null) {
if (Boolean.TRUE.equals(this.includeException)) {
options = options.including(Include.EXCEPTION);
}
if (!options.isIncluded(Include.EXCEPTION)) {

Loading…
Cancel
Save