@@ -116,9 +116,9 @@ func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerReq
116116 resp , err := s .client .ContainerCreate (ctx , & config , & hostConfig , & networkConfig , & platform , req .Name )
117117 if err != nil {
118118 if client .IsErrNotFound (err ) {
119- return nil , status .Errorf (codes .NotFound , err .Error ())
119+ return nil , status .Error (codes .NotFound , err .Error ())
120120 }
121- return nil , status .Errorf (codes .Internal , err .Error ())
121+ return nil , status .Error (codes .Internal , err .Error ())
122122 }
123123
124124 respBytes , err := json .Marshal (resp )
@@ -134,9 +134,9 @@ func (s *Server) InspectContainer(ctx context.Context, req *pb.InspectContainerR
134134 resp , err := s .client .ContainerInspect (ctx , req .Id )
135135 if err != nil {
136136 if client .IsErrNotFound (err ) {
137- return nil , status .Errorf (codes .NotFound , err .Error ())
137+ return nil , status .Error (codes .NotFound , err .Error ())
138138 }
139- return nil , status .Errorf (codes .Internal , err .Error ())
139+ return nil , status .Error (codes .Internal , err .Error ())
140140 }
141141
142142 respBytes , err := json .Marshal (resp )
@@ -167,9 +167,9 @@ func (s *Server) StartContainer(ctx context.Context, req *pb.StartContainerReque
167167
168168 if err := s .client .ContainerStart (ctx , req .Id , opts ); err != nil {
169169 if client .IsErrNotFound (err ) {
170- return nil , status .Errorf (codes .NotFound , err .Error ())
170+ return nil , status .Error (codes .NotFound , err .Error ())
171171 }
172- return nil , status .Errorf (codes .Internal , err .Error ())
172+ return nil , status .Error (codes .Internal , err .Error ())
173173 }
174174
175175 return & emptypb.Empty {}, nil
@@ -186,9 +186,9 @@ func (s *Server) StopContainer(ctx context.Context, req *pb.StopContainerRequest
186186
187187 if err := s .client .ContainerStop (ctx , req .Id , opts ); err != nil {
188188 if client .IsErrNotFound (err ) {
189- return nil , status .Errorf (codes .NotFound , err .Error ())
189+ return nil , status .Error (codes .NotFound , err .Error ())
190190 }
191- return nil , status .Errorf (codes .Internal , err .Error ())
191+ return nil , status .Error (codes .Internal , err .Error ())
192192 }
193193
194194 return & emptypb.Empty {}, nil
@@ -218,7 +218,7 @@ func (s *Server) ListContainers(ctx context.Context, req *pb.ListContainersReque
218218
219219 containerSummaries , err := s .client .ContainerList (ctx , opts )
220220 if err != nil {
221- return nil , status .Errorf (codes .Internal , err .Error ())
221+ return nil , status .Error (codes .Internal , err .Error ())
222222 }
223223 containers := make ([]types.ContainerJSON , 0 , len (containerSummaries ))
224224 for _ , cs := range containerSummaries {
@@ -258,9 +258,9 @@ func (s *Server) RemoveContainer(ctx context.Context, req *pb.RemoveContainerReq
258258
259259 if err := s .client .ContainerRemove (ctx , req .Id , opts ); err != nil {
260260 if client .IsErrNotFound (err ) {
261- return nil , status .Errorf (codes .NotFound , err .Error ())
261+ return nil , status .Error (codes .NotFound , err .Error ())
262262 }
263- return nil , status .Errorf (codes .Internal , err .Error ())
263+ return nil , status .Error (codes .Internal , err .Error ())
264264 }
265265
266266 return & emptypb.Empty {}, nil
@@ -286,7 +286,7 @@ func (s *Server) PullImage(req *pb.PullImageRequest, stream grpc.ServerStreaming
286286
287287 respBody , err := s .client .ImagePull (ctx , req .Image , opts )
288288 if err != nil {
289- return status .Errorf (codes .Internal , err .Error ())
289+ return status .Error (codes .Internal , err .Error ())
290290 }
291291 defer respBody .Close ()
292292
@@ -317,7 +317,7 @@ func (s *Server) PullImage(req *pb.PullImageRequest, stream grpc.ServerStreaming
317317 case err = <- errCh :
318318 return err
319319 case <- ctx .Done ():
320- return status .Errorf (codes .Canceled , ctx .Err ().Error ())
320+ return status .Error (codes .Canceled , ctx .Err ().Error ())
321321 }
322322 }
323323}
@@ -327,9 +327,9 @@ func (s *Server) InspectImage(ctx context.Context, req *pb.InspectImageRequest)
327327 resp , _ , err := s .client .ImageInspectWithRaw (ctx , req .Id )
328328 if err != nil {
329329 if client .IsErrNotFound (err ) {
330- return nil , status .Errorf (codes .NotFound , err .Error ())
330+ return nil , status .Error (codes .NotFound , err .Error ())
331331 }
332- return nil , status .Errorf (codes .Internal , err .Error ())
332+ return nil , status .Error (codes .Internal , err .Error ())
333333 }
334334
335335 respBytes , err := json .Marshal (resp )
@@ -724,9 +724,9 @@ func (s *Server) InspectServiceContainer(
724724 serviceCtr , err := s .service .InspectServiceContainer (ctx , req .Id )
725725 if err != nil {
726726 if client .IsErrNotFound (err ) {
727- return nil , status .Errorf (codes .NotFound , err .Error ())
727+ return nil , status .Error (codes .NotFound , err .Error ())
728728 }
729- return nil , status .Errorf (codes .Internal , err .Error ())
729+ return nil , status .Error (codes .Internal , err .Error ())
730730 }
731731
732732 ctrBytes , err := json .Marshal (serviceCtr .Container )
0 commit comments