better error handling

This commit is contained in:
2022-06-03 14:27:40 +02:00
parent 2be2cc0626
commit 2f5cd563ad
5 changed files with 27 additions and 3 deletions

View File

@@ -73,7 +73,7 @@ func (c *Client) CreateShare(ctx context.Context, key string) (*types.Share, err
}
if !exists {
return nil, errors.New("key does not exist")
return nil, types.ErrKeyNotFound
}
err = c.db.CreateShare(ctx, share)