diff options
Diffstat (limited to 'workhorse/internal/git/info-refs.go')
-rw-r--r-- | workhorse/internal/git/info-refs.go | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/workhorse/internal/git/info-refs.go b/workhorse/internal/git/info-refs.go index 2eaed388f60..3e0e4dcb3e5 100644 --- a/workhorse/internal/git/info-refs.go +++ b/workhorse/internal/git/info-refs.go @@ -14,7 +14,7 @@ import ( "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/gitaly" - "gitlab.com/gitlab-org/gitlab/workhorse/internal/helper" + "gitlab.com/gitlab-org/gitlab/workhorse/internal/helper/fail" ) func GetInfoRefsHandler(a *api.API) http.Handler { @@ -47,21 +47,16 @@ func handleGetInfoRefs(rw http.ResponseWriter, r *http.Request, a *api.Response) err = fmt.Errorf("handleGetInfoRefs: %v", err) if status != nil && status.Code() == grpccodes.Unavailable { - helper.CaptureAndFail(responseWriter, r, err, "The git server, Gitaly, is not available at this time. Please contact your administrator.", http.StatusServiceUnavailable) + fail.Request(responseWriter, r, err, fail.WithStatus(http.StatusServiceUnavailable), + fail.WithBody("The git server, Gitaly, is not available at this time. Please contact your administrator.")) } else { - helper.Fail500(responseWriter, r, err) + fail.Request(responseWriter, r, err) } } } func handleGetInfoRefsWithGitaly(ctx context.Context, responseWriter *HttpResponseWriter, a *api.Response, rpc, gitProtocol, encoding string) error { - ctx, smarthttp, err := gitaly.NewSmartHTTPClient( - ctx, - a.GitalyServer, - gitaly.WithFeatures(a.GitalyServer.Features), - gitaly.WithUserID(a.GL_ID), - gitaly.WithUsername(a.GL_USERNAME), - ) + ctx, smarthttp, err := gitaly.NewSmartHTTPClient(ctx, a.GitalyServer) if err != nil { return err } |