Skip to content

Commit c49605c

Browse files
Lopfestscottfrederick
authored andcommitted
Fix include exception handling in DefaultErrorAttributes
This commit fixes a problem with the handling of the includeException field in DefaultErrorAttributes. See gh-22750
1 parent d452bbb commit c49605c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/error/DefaultErrorAttributes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public DefaultErrorAttributes(boolean includeException) {
8686
@Override
8787
public Map<String, Object> getErrorAttributes(ServerRequest request, ErrorAttributeOptions options) {
8888
Map<String, Object> errorAttributes = getErrorAttributes(request, options.isIncluded(Include.STACK_TRACE));
89-
if (this.includeException != null) {
89+
if (Boolean.TRUE.equals(this.includeException)) {
9090
options = options.including(Include.EXCEPTION);
9191
}
9292
if (!options.isIncluded(Include.EXCEPTION)) {

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/error/DefaultErrorAttributes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private void storeErrorAttributes(HttpServletRequest request, Exception ex) {
108108
@Override
109109
public Map<String, Object> getErrorAttributes(WebRequest webRequest, ErrorAttributeOptions options) {
110110
Map<String, Object> errorAttributes = getErrorAttributes(webRequest, options.isIncluded(Include.STACK_TRACE));
111-
if (this.includeException != null) {
111+
if (Boolean.TRUE.equals(this.includeException)) {
112112
options = options.including(Include.EXCEPTION);
113113
}
114114
if (!options.isIncluded(Include.EXCEPTION)) {

0 commit comments

Comments
 (0)