From 11612a802ccda6f3dd7e34269535f78653422173 Mon Sep 17 00:00:00 2001 From: Pavel Sviderski Date: Wed, 4 Dec 2024 16:29:04 +1000 Subject: [PATCH] forward NotFound errors from StartContainer and RemoveContainer --- internal/machine/docker/server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/machine/docker/server.go b/internal/machine/docker/server.go index fcd66aa5..cf0bf937 100644 --- a/internal/machine/docker/server.go +++ b/internal/machine/docker/server.go @@ -76,6 +76,9 @@ func (s *Server) StartContainer(ctx context.Context, req *pb.StartContainerReque } if err := s.client.ContainerStart(ctx, req.Id, opts); err != nil { + if client.IsErrNotFound(err) { + return nil, status.Errorf(codes.NotFound, "start container: %v", err) + } return nil, status.Errorf(codes.Internal, "start container: %v", err) } @@ -133,6 +136,9 @@ func (s *Server) RemoveContainer(ctx context.Context, req *pb.RemoveContainerReq } if err := s.client.ContainerRemove(ctx, req.Id, opts); err != nil { + if client.IsErrNotFound(err) { + return nil, status.Errorf(codes.NotFound, "remove container: %v", err) + } return nil, status.Errorf(codes.Internal, "remove container: %v", err) }