Skip to content

Commit

Permalink
rbd: add ErrExist as standard error
Browse files Browse the repository at this point in the history
Certain operations with RBD can return the C errno EEXIST. Applications
using go-ceph benefit from easily detecting this error.

Signed-off-by: Niels de Vos <[email protected]>
  • Loading branch information
nixpanic authored and mergify[bot] committed Sep 25, 2024
1 parent b4bdfbd commit 5a7f9c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rbd/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ var (

// Public general error
const (
// ErrExist indicates a non-specific already existing resource.
ErrExist = rbdError(-C.EEXIST)
// ErrNotExist indicates a non-specific missing resource.
ErrNotExist = rbdError(-C.ENOENT)
// ErrNotImplemented indicates a function is not implemented in by librbd.
Expand Down

0 comments on commit 5a7f9c9

Please sign in to comment.