mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
util: simplify error handling
The sentinel error code had additional fields in the errors, that are used nowhere. This leads to unneccesarily complicated code. This change replaces the sentinel errors in utils with standard errors created with errors.New() and adds a simple JoinErrors() function to be able to combine sentinel errors from different code tiers. Related: #1203 Signed-off-by: Sven Anderson <sven@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
c277ed588d
commit
8393fbe40b
@ -74,7 +74,7 @@ func (cc *ClusterConnection) GetIoctx(pool string) (*rados.IOContext, error) {
|
||||
if err != nil {
|
||||
// ErrNotFound indicates the Pool was not found
|
||||
if errors.Is(err, rados.ErrNotFound) {
|
||||
err = ErrPoolNotFound{pool, err}
|
||||
err = JoinErrors(ErrPoolNotFound, err)
|
||||
} else {
|
||||
err = fmt.Errorf("failed to open IOContext for pool %s: %w", pool, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user