mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
cephfs: simplify error handling
This change replaces the sentinel errors in cephfs module with standard errors created with errors.New(). Related: #1203 Signed-off-by: Sven Anderson <sven@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
7c9c7c78a7
commit
dba2c27bcb
@ -70,7 +70,7 @@ func getVolumeRootPathCeph(ctx context.Context, volOptions *volumeOptions, cr *u
|
||||
klog.Errorf(util.Log(ctx, "failed to get the rootpath for the vol %s(%s) stdError %s"), string(volID), err, stdErrString)
|
||||
|
||||
if strings.HasPrefix(stdErrString, errNotFoundString) {
|
||||
return "", ErrVolumeNotFound{err}
|
||||
return "", util.JoinErrors(ErrVolumeNotFound, err)
|
||||
}
|
||||
|
||||
return "", err
|
||||
@ -215,7 +215,7 @@ func purgeVolume(ctx context.Context, volID volumeID, cr *util.Credentials, volO
|
||||
klog.Errorf(util.Log(ctx, "failed to purge subvolume %s(%s) in fs %s"), string(volID), err, volOptions.FsName)
|
||||
|
||||
if strings.HasPrefix(err.Error(), errNotFoundString) {
|
||||
return ErrVolumeNotFound{err}
|
||||
return util.JoinErrors(ErrVolumeNotFound, err)
|
||||
}
|
||||
|
||||
return err
|
||||
|
Reference in New Issue
Block a user