From f94f640ec40deddd1f57049d3e4c25a12adaf367 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Thu, 30 Sep 2021 12:20:06 +0100 Subject: Resolve an error-swallowing issue --- internal/command/lfsauthenticate/lfsauthenticate.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/command/lfsauthenticate/lfsauthenticate.go b/internal/command/lfsauthenticate/lfsauthenticate.go index dab69ab..ac3aafc 100644 --- a/internal/command/lfsauthenticate/lfsauthenticate.go +++ b/internal/command/lfsauthenticate/lfsauthenticate.go @@ -6,6 +6,8 @@ import ( "encoding/json" "fmt" + "gitlab.com/gitlab-org/labkit/log" + "gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs" "gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter" "gitlab.com/gitlab-org/gitlab-shell/internal/command/shared/accessverifier" @@ -58,6 +60,11 @@ func (c *Command) Execute(ctx context.Context) error { payload, err := c.authenticate(ctx, operation, repo, accessResponse.UserId) if err != nil { // return nothing just like Ruby's GitlabShell#lfs_authenticate does + log.WithContextFields( + ctx, + log.Fields{"operation": operation, "repo": repo, "user_id": accessResponse.UserId}, + ).WithError(err).Debug("lfsauthenticate: execute: LFS authentication failed") + return nil } -- cgit v1.2.1