Currently when you extend DefaultErrorAttributes and create new object with deprecated constructor, there is no way to disable exception attribute in error output even if you specify server.error.include-exception=false
in application.properties.
If this.includeException
is false
, it should not be included in ErrorAttributeOptions.
With this fix it should work properly, meaning if this.includeException
is null
or false
, exception is not included.
Since: 2.3.0 Related commit: https://github.com/spring-projects/spring-boot/commit/158933c3e57e921a0339cdb7635b12ae0ad89832
Comment From: pivotal-issuemaster
@Lopfest Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
Comment From: pivotal-issuemaster
@Lopfest Thank you for signing the Contributor License Agreement!
Comment From: scottfrederick
@Lopfest Thank you for your first contribution to Spring Boot. Your change has been merged along with another commit that adds tests to verify the broken behavior before your change and confirm the fix after your change.
The change was applied to the 2.3.x
branch instead of master
so we can include it in the next 2.3.x
release and in the upcoming 2.4.x
releases.