Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception inclusion cannot be disabled when sub-classing DefaultErrorAttributes and using its deprecated constructor #22750

Closed
wants to merge 1 commit into from

Conversation

Lopfest
Copy link
Contributor

@Lopfest Lopfest commented Aug 5, 2020

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: 158933c

@pivotal-issuemaster
Copy link

@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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 5, 2020
@pivotal-issuemaster
Copy link

@Lopfest Thank you for signing the Contributor License Agreement!

@scottfrederick scottfrederick self-assigned this Aug 7, 2020
@scottfrederick scottfrederick added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 13, 2020
@scottfrederick scottfrederick added this to the 2.3.x milestone Aug 13, 2020
@scottfrederick scottfrederick changed the base branch from master to 2.3.x August 13, 2020 21:06
@scottfrederick scottfrederick changed the base branch from 2.3.x to master August 13, 2020 21:07
scottfrederick pushed a commit to scottfrederick/spring-boot that referenced this pull request Aug 17, 2020
This commit fixes a problem with the handling of the includeException
field in DefaultErrorAttributes.

See spring-projectsgh-22750
scottfrederick added a commit to scottfrederick/spring-boot that referenced this pull request Aug 17, 2020
@philwebb philwebb closed this in b8a8b85 Aug 17, 2020
@scottfrederick
Copy link
Contributor

scottfrederick commented Aug 17, 2020

@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.

@scottfrederick scottfrederick modified the milestones: 2.3.x, 2.3.4 Aug 17, 2020
@wilkinsona wilkinsona changed the title Do not include error exception attribute when not specified Exception inclusion cannot be disabled when sub-classing DefaultErrorAttributes and using its deprecated constructor Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants