Commit c49605cd authored by Lopfest's avatar Lopfest Committed by Scott Frederick

Fix include exception handling in DefaultErrorAttributes

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

See gh-22750
parent d452bbbe
...@@ -86,7 +86,7 @@ public class DefaultErrorAttributes implements ErrorAttributes { ...@@ -86,7 +86,7 @@ public class DefaultErrorAttributes implements ErrorAttributes {
@Override @Override
public Map<String, Object> getErrorAttributes(ServerRequest request, ErrorAttributeOptions options) { public Map<String, Object> getErrorAttributes(ServerRequest request, ErrorAttributeOptions options) {
Map<String, Object> errorAttributes = getErrorAttributes(request, options.isIncluded(Include.STACK_TRACE)); 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); options = options.including(Include.EXCEPTION);
} }
if (!options.isIncluded(Include.EXCEPTION)) { if (!options.isIncluded(Include.EXCEPTION)) {
......
...@@ -108,7 +108,7 @@ public class DefaultErrorAttributes implements ErrorAttributes, HandlerException ...@@ -108,7 +108,7 @@ public class DefaultErrorAttributes implements ErrorAttributes, HandlerException
@Override @Override
public Map<String, Object> getErrorAttributes(WebRequest webRequest, ErrorAttributeOptions options) { public Map<String, Object> getErrorAttributes(WebRequest webRequest, ErrorAttributeOptions options) {
Map<String, Object> errorAttributes = getErrorAttributes(webRequest, options.isIncluded(Include.STACK_TRACE)); 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); options = options.including(Include.EXCEPTION);
} }
if (!options.isIncluded(Include.EXCEPTION)) { if (!options.isIncluded(Include.EXCEPTION)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment