Skip to content

Permission denied error could be handled better #47

Closed
@Naktibalda

Description

@Naktibalda

Vault returns status 400 with body {"errors":["permission denied"]} if access token is incorrect or has insufficient permissions.

On receiving such status, vault-java-driver throws com.bettercloud.vault.VaultException: Expecting HTTP status 204 or 200, but instead receiving 400.
Which is very confusing, because Vault documentation says that it means 400 - Invalid request, missing or invalid data. See the "validation" section for more details on the error response.
And it doesn't provide any more details.

vault-java-driver makes it hard to debug by not exposing response body.
I think that vault-java-driver should incorporate contents of errors field in exception message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions