task service: return known error type
Found this error in a docker daemon log classified as an "uknown" error. Since we know what this is return the correct error type so it can be handled. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
f6c1e7ed8b
commit
02e77bcdc1
@ -210,7 +210,7 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc.
|
||||
return nil, errdefs.ToGRPC(err)
|
||||
}
|
||||
if err == nil {
|
||||
return nil, errdefs.ToGRPC(fmt.Errorf("task %s already exists", r.ContainerID))
|
||||
return nil, errdefs.ToGRPC(fmt.Errorf("task %s: %w", r.ContainerID, errdefs.ErrAlreadyExists))
|
||||
}
|
||||
c, err := rtime.Create(ctx, r.ContainerID, opts)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user