lint: gRPC status.Error for static error messages

This commit is contained in:
Pasha Sviderski
2025-09-15 17:11:12 +10:00
parent 1f62e30a08
commit b6e9766f40
3 changed files with 20 additions and 20 deletions
+2 -2
View File
@@ -27,9 +27,9 @@ func (s *Server) GetConfig(ctx context.Context, _ *emptypb.Empty) (*pb.GetCaddyC
caddyfile, modifiedAt, err := s.service.Caddyfile()
if err != nil {
if os.IsNotExist(err) {
return nil, status.Errorf(codes.NotFound, err.Error())
return nil, status.Error(codes.NotFound, err.Error())
}
return nil, status.Errorf(codes.Internal, err.Error())
return nil, status.Error(codes.Internal, err.Error())
}
return &pb.GetCaddyConfigResponse{