Use error interfaces for content/metadata
These interfaces allow us to preserve both the checking of error "cause" as well as messages returned from the gRPC API so that the client gets full error reason instead of a default "metadata: not found" in the case of a missing image. Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
This commit is contained in:
@@ -27,9 +27,9 @@ func rewriteGRPCError(err error) error {
|
||||
|
||||
switch grpc.Code(errors.Cause(err)) {
|
||||
case codes.AlreadyExists:
|
||||
return metadata.ErrExists
|
||||
return metadata.ErrExists(grpc.ErrorDesc(err))
|
||||
case codes.NotFound:
|
||||
return metadata.ErrNotFound
|
||||
return metadata.ErrNotFound(grpc.ErrorDesc(err))
|
||||
}
|
||||
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user