Merge pull request #6079 from cpuguy83/correct_task_error
task service: return known error type
This commit is contained in:
commit
64291df71b
@ -209,7 +209,7 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc.
|
|||||||
return nil, errdefs.ToGRPC(err)
|
return nil, errdefs.ToGRPC(err)
|
||||||
}
|
}
|
||||||
if err == nil {
|
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)
|
c, err := rtime.Create(ctx, r.ContainerID, opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user