Skip to content

Commit dc207b6

Browse files
Merge pull request #4860 from masters-of-cats/pr-process-not-found-err
Return GRPC not found error instead of plain one
2 parents ce70245 + 7451dd1 commit dc207b6

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

container_linux_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,10 @@ func TestContainerLoadUnexistingProcess(t *testing.T) {
11781178
t.Fatal("an error should have occurred when loading a process that does not exist")
11791179
}
11801180

1181+
if !errdefs.IsNotFound(err) {
1182+
t.Fatalf("an error of type NotFound should have been returned when loading a process that does not exist, got %#v instead ", err)
1183+
}
1184+
11811185
if err := task.Kill(ctx, syscall.SIGKILL); err != nil {
11821186
t.Error(err)
11831187
}

runtime/v2/runc/v2/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ func (s *service) State(ctx context.Context, r *taskAPI.StateRequest) (*taskAPI.
483483
}
484484
p, err := container.Process(r.ExecID)
485485
if err != nil {
486-
return nil, err
486+
return nil, errdefs.ToGRPC(err)
487487
}
488488
st, err := p.Status(ctx)
489489
if err != nil {

0 commit comments

Comments
 (0)