rbd: return GRPC error message

The error message return from the GRPC
should be of GRPC error messages only
not the normal go errors. This commits
returns GRPC error if setAllMetadata
fails.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 69eb6e40dc)
This commit is contained in:
Madhu Rajanna 2022-10-14 14:47:52 +02:00 committed by mergify[bot]
parent 42bed5a346
commit a3a0730900

View File

@ -388,7 +388,7 @@ func (cs *ControllerServer) CreateVolume(
log.ErrorLog(ctx, "failed to delete rbd image: %s with error: %v", rbdVol, deleteErr)
}
return nil, err
return nil, status.Error(codes.Internal, err.Error())
}
return buildCreateVolumeResponse(req, rbdVol), nil