Skip to content

Commit 02e77bc

Browse files
committed
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 <[email protected]>
1 parent f6c1e7e commit 02e77bc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

services/tasks/local.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc.
210210
return nil, errdefs.ToGRPC(err)
211211
}
212212
if err == nil {
213-
return nil, errdefs.ToGRPC(fmt.Errorf("task %s already exists", r.ContainerID))
213+
return nil, errdefs.ToGRPC(fmt.Errorf("task %s: %w", r.ContainerID, errdefs.ErrAlreadyExists))
214214
}
215215
c, err := rtime.Create(ctx, r.ContainerID, opts)
216216
if err != nil {

0 commit comments

Comments
 (0)