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

BREAKING: don’t expose Exception::getMessage as detail #156

Merged
merged 1 commit into from
Apr 28, 2022
Merged

Conversation

sdelamo
Copy link
Contributor

@sdelamo sdelamo commented Apr 28, 2022

Unless the exception is of type ThrowableProblem or UnsatisfiedRouteException

This aims to prevent accidental information leakage.

Fixes: #144

Close: #151

Unless the exception is of type ThrowableProblem or UnsatisfiedRouteException

This aims to prevent accidental information leakage.

Fixes: #144
@sdelamo sdelamo added type: breaking Introduces a breaking change closed: notabug The issue is not a bug labels Apr 28, 2022
@sdelamo sdelamo added this to the 2.2.3 milestone Apr 28, 2022
@sonarcloud
Copy link

sonarcloud bot commented Apr 28, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@sdelamo
Copy link
Contributor Author

sdelamo commented Apr 28, 2022

@hollingsworthd

This pull request is an alternative solution to #144.

There are some exceptions for which we expose the Exception::getMessage as the Problem detail.
For example, the UnsatisfiedRouteException message helps the API consumer debug a missing query value parameter in the request.
I have created a protected method in ProblemErrorResponseProccessor so that this is easily customizable by the users.

Let me know what you think.

@sdelamo sdelamo removed the closed: notabug The issue is not a bug label Apr 28, 2022
@hollingsworthd
Copy link
Contributor

Looks good. I like the simplicity of the approach and for anything more complicated directing users to override the Java API to customize the returned problem.

@sdelamo sdelamo merged commit 8987729 into 2.2.x Apr 28, 2022
@sdelamo sdelamo deleted the issue-144 branch April 28, 2022 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: breaking Introduces a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants