rbd: simplify error handling

This change replaces the sentinel errors in rbd module with
standard errors created with errors.New().

Related: #1203

Signed-off-by: Sven Anderson <sven@redhat.com>
This commit is contained in:
Sven Anderson
2020-07-10 03:05:42 +02:00
committed by mergify[bot]
parent dba2c27bcb
commit 92884f56f4
7 changed files with 61 additions and 167 deletions

View File

@ -654,8 +654,7 @@ func (ns *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstag
}
// If not mounted, and error is anything other than metadata file missing, it is an error
var ems ErrMissingStash
if !errors.As(err, &ems) {
if !errors.Is(err, ErrMissingStash) {
return nil, status.Error(codes.Internal, err.Error())
}