services/content: move service client into package

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2017-02-28 17:10:59 -08:00
parent 4793f968e5
commit 5da4e1d0d2
10 changed files with 136 additions and 102 deletions

View file

@ -0,0 +1,19 @@
package content
import (
"github.com/docker/containerd/content"
"github.com/pkg/errors"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
)
func rewriteGRPCError(err error) error {
switch grpc.Code(errors.Cause(err)) {
case codes.AlreadyExists:
return content.ErrExists
case codes.NotFound:
return content.ErrNotFound
}
return err
}