-
Notifications
You must be signed in to change notification settings - Fork 189
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
VaultException thrown without "cause" hides important information #713
Comments
How about submitting a pull request so we can continue the discussion over actual code changes? |
Fair enough. Let me get something together to at least look at. My issue that triggered this ticket is that Apache httpcomponents is throwing a |
Looks I am just lucky. I found only 3 cases. But I'm encountering 1 of them. Such is life. Here are links to the lines of code. Does that work? |
I created a local build that adds the local exception variable as "cause" argument to the constructor. Very minimal changes vs. 2.3.2 worked when running locally. |
|
There is another case : ReactiveVaultTemplate should work the same as VaultTemplate |
How exactly do you intend to extract a cause from a HTTP status code that isn't communicated as exception? |
In general, exception handlers should preserve the original exception so eventually, a full stack trace to the original offending code can be logged. This gives developer the ability to quickly zero in on the precise issue and time to resolve problems is dramatically reduced.
This principle is described by a SonarQube issue RSPEC-1166.
I am finding that, in a number of places, the
spring-vault
project is suppressing the original exception. The original message is usually logged, but the exact location where the exception was thrown is lost.The fix is to simply include the original exception with
VaultException
- or derived type - as the "cause".The text was updated successfully, but these errors were encountered: