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:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-08-11 12:01:56 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-08-11 13:44:07 +0300
commit8778b7d66e04455f07e0a0357f7d553866ed48c6 (patch)
tree1da07d5126ed04caf213343aa6fbd5905614f297
parent3ec72513ce59862f022cf5375f1d4739653f8cee (diff)
quarantine: Retain gRPC error codes returned by the locator
While our `config.Locator` implementation already knows to return proper gRPC error codes, we don't retain them when creating new quarantine directories. Fix this issue by using `helper.ErrInternalf()`.
-rw-r--r--internal/git/quarantine/quarantine.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/git/quarantine/quarantine.go b/internal/git/quarantine/quarantine.go
index 517c122e7..c1c39d4cb 100644
--- a/internal/git/quarantine/quarantine.go
+++ b/internal/git/quarantine/quarantine.go
@@ -11,6 +11,7 @@ import (
"strings"
"gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/storage"
+ "gitlab.com/gitlab-org/gitaly/v14/internal/helper"
"gitlab.com/gitlab-org/gitaly/v14/internal/tempdir"
"gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb"
"google.golang.org/protobuf/proto"
@@ -34,7 +35,7 @@ type Dir struct {
func New(ctx context.Context, repo *gitalypb.Repository, locator storage.Locator) (*Dir, error) {
repoPath, err := locator.GetPath(repo)
if err != nil {
- return nil, fmt.Errorf("creating quarantine: %w", err)
+ return nil, helper.ErrInternalf("getting repo path: %w", err)
}
quarantineDir, err := tempdir.NewWithPrefix(ctx, repo.GetStorageName(),