mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 11:38:02 +00:00
Errwrap everywhere (#4252)
* package api * package builtin/credential * package builtin/logical * package command * package helper * package http and logical * package physical * package shamir * package vault * package vault * address feedback * more fixes
This commit is contained in:
@@ -4,6 +4,8 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/errwrap"
|
||||
multierror "github.com/hashicorp/go-multierror"
|
||||
"github.com/hashicorp/go-uuid"
|
||||
"github.com/hashicorp/vault/logical"
|
||||
"github.com/hashicorp/vault/logical/framework"
|
||||
@@ -82,11 +84,12 @@ func (b *backend) pathCredsRead(ctx context.Context, req *logical.Request, d *fr
|
||||
Write: permission.Write,
|
||||
Read: permission.Read,
|
||||
}); err != nil {
|
||||
outerErr := errwrap.Wrapf(fmt.Sprintf("failed to update permissions to the %q user: {{err}}", username), err)
|
||||
// Delete the user because it's in an unknown state
|
||||
if _, rmErr := client.DeleteUser(username); rmErr != nil {
|
||||
return nil, fmt.Errorf("failed to delete user:%s, err: %s. %s", username, err, rmErr)
|
||||
return nil, multierror.Append(errwrap.Wrapf("failed to delete user: {{err}}", rmErr), outerErr)
|
||||
}
|
||||
return nil, fmt.Errorf("failed to update permissions to the %s user. err:%s", username, err)
|
||||
return nil, outerErr
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user