Skip to content

Include response body to exception message #49

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

Merged

Conversation

Naktibalda
Copy link
Contributor

Status code isn't sufficient to understand the error in some cases,
so I made this patch to include response body to exception message.

Examples of exception message:

com.bettercloud.vault.VaultException: Expecting HTTP status 204 or 200, but instead receiving 403
Response body: {"errors":["permission denied"]}
Vault responded with HTTP status code: 404
Response body: {"errors":[]}

Closes #47

It eases debugging,
Example of exception message:
com.bettercloud.vault.VaultException: Expecting HTTP status 204 or 200, but instead receiving 403
Response body: {"errors":["permission denied"]}
@steve-perkins
Copy link
Contributor

This looks great, thanks! But in the process of merging an earlier PR, a merge conflict resulted for this one. If you could please resolve it, then I'd be happy to merge.

@Naktibalda
Copy link
Contributor Author

Done.

@steve-perkins steve-perkins merged commit 552c42d into BetterCloud:master May 17, 2017
@steve-perkins
Copy link
Contributor

Thanks so much!

jentfoo pushed a commit to jentfoo/vault-java-driver that referenced this pull request Jun 13, 2019
mikegrass added a commit to mikegrass/vault-java-driver that referenced this pull request Dec 5, 2019
Similar to BetterCloud#49, it
including the response body in the exception thrown for auth failures
provides information that is helpful for debugging failed logins.

Add the response body to the VaultException thrown when an Auth
method fails.
mikegrass added a commit to mikegrass/vault-java-driver that referenced this pull request Dec 5, 2019
Similar to BetterCloud#49,
including the response body in the exception thrown for auth failures
provides information that is helpful for debugging failed logins.

Add the response body to the VaultException thrown when an Auth
method fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants