Normalize 'already exists' errors

and fix some error messages where they were wrong or redundant

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
Daniel Nephin
2017-11-15 16:46:27 -05:00
parent a542cf7dac
commit 2e7f7318cc
4 changed files with 5 additions and 5 deletions

View File

@@ -55,7 +55,7 @@ func (lm *LeaseManager) Create(ctx context.Context, lid string, labels map[strin
if err == bolt.ErrBucketExists {
err = errdefs.ErrAlreadyExists
}
return Lease{}, err
return Lease{}, errors.Wrapf(err, "lease %q", lid)
}
t := time.Now().UTC()