improve error message

Signed-off-by: yason <yan.xuean@zte.com.cn>
This commit is contained in:
yason
2017-12-01 15:05:37 +08:00
parent efe9e284fd
commit 4f1c0e067e
2 changed files with 6 additions and 5 deletions

View File

@@ -359,7 +359,8 @@ func (s *snapshotter) Commit(ctx context.Context, name, key string, opts ...snap
return update(ctx, s.db, func(tx *bolt.Tx) error {
bkt := getSnapshotterBucket(tx, ns, s.name)
if bkt == nil {
return errors.Wrapf(errdefs.ErrNotFound, "snapshot %v does not exist", key)
return errors.Wrapf(errdefs.ErrNotFound,
"can not find snapshotter %q", s.name)
}
bbkt, err := bkt.CreateBucket([]byte(name))