Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Cai <jcai@gitlab.com>2022-11-11 17:06:00 +0300
committerJohn Cai <jcai@gitlab.com>2022-11-11 17:06:00 +0300
commitf5ae1c49fa46452a6ee3049165473e71ccaee088 (patch)
tree5f3599d4b5e0789452c97229270a043d7141833c
parent081d52b6b28437bc8d3a17b6e3d8d80620c640f9 (diff)
parente978322c85c9a2f469eb0ad26fe3d66daccac410 (diff)
Merge branch 'ps-internalgitaly-fix' into 'master'
internalgitaly: Standardize errors creation See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5043 Merged-by: John Cai <jcai@gitlab.com> Approved-by: John Cai <jcai@gitlab.com> Co-authored-by: Pavlo Strokov <pstrokov@gitlab.com>
-rw-r--r--internal/gitaly/service/internalgitaly/walkrepos.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/internal/gitaly/service/internalgitaly/walkrepos.go b/internal/gitaly/service/internalgitaly/walkrepos.go
index fec13966c..6dad15e01 100644
--- a/internal/gitaly/service/internalgitaly/walkrepos.go
+++ b/internal/gitaly/service/internalgitaly/walkrepos.go
@@ -6,9 +6,8 @@ import (
"path/filepath"
"gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/storage"
+ "gitlab.com/gitlab-org/gitaly/v15/internal/helper"
"gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb"
- "google.golang.org/grpc/codes"
- "google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"
)
@@ -18,7 +17,7 @@ func (s *server) WalkRepos(req *gitalypb.WalkReposRequest, stream gitalypb.Inter
return err
}
- return walkStorage(stream.Context(), sPath, stream)
+ return helper.ErrInternal(walkStorage(stream.Context(), sPath, stream))
}
func (s *server) storagePath(storageName string) (string, error) {
@@ -27,10 +26,7 @@ func (s *server) storagePath(storageName string) (string, error) {
return storage.Path, nil
}
}
- return "", status.Errorf(
- codes.NotFound,
- "storage name %q not found", storageName,
- )
+ return "", helper.ErrNotFoundf("storage name %q not found", storageName)
}
func walkStorage(ctx context.Context, storagePath string, stream gitalypb.InternalGitaly_WalkReposServer) error {