diff options
Diffstat (limited to 'internal/gitaly/service/repository/config.go')
-rw-r--r-- | internal/gitaly/service/repository/config.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/internal/gitaly/service/repository/config.go b/internal/gitaly/service/repository/config.go index d99cc36dc..1a0ba2464 100644 --- a/internal/gitaly/service/repository/config.go +++ b/internal/gitaly/service/repository/config.go @@ -9,8 +9,6 @@ import ( "gitlab.com/gitlab-org/gitaly/v15/internal/helper" "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/v15/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) // GetConfig reads the repository's gitconfig file and returns its contents. @@ -31,9 +29,9 @@ func (s *server) GetConfig( gitconfig, err := os.Open(configPath) if err != nil { if os.IsNotExist(err) { - return status.Errorf(codes.NotFound, "opening gitconfig: %v", err) + return helper.ErrNotFoundf("opening gitconfig: %w", err) } - return helper.ErrInternalf("opening gitconfig: %v", err) + return helper.ErrInternalf("opening gitconfig: %w", err) } writer := streamio.NewWriter(func(p []byte) error { @@ -43,7 +41,7 @@ func (s *server) GetConfig( }) if _, err := io.Copy(writer, gitconfig); err != nil { - return helper.ErrInternalf("sending config: %v", err) + return helper.ErrInternalf("sending config: %w", err) } return nil |