Skip to content

Conversation

@keegancsmith
Copy link
Member

Before this if the git command failed we would nil panic since the Logger on gitservice.Handler was not set. This commit updates us to the latest version of lib which instead takes in an error hook so we can use the attached stdlib logger.

Corresponding PR at https://github.com/sourcegraph/sourcegraph/pull/56611

Test Plan: go test

return filepath.Join(s.Root, filepath.FromSlash(name))
},
ErrorHook: func(err error, stderr string) {
s.Info.Printf("git-service error: %s\nstderr:\n%s", err.Error(), stderr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info? Why not Error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no error in this case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:sad-trombone:

Before this if the git command failed we would nil panic since the
Logger on gitservice.Handler was not set. This commit updates us to the
latest version of lib which instead takes in an error hook so we can use
the attached stdlib logger.

Test Plan: go test
@keegancsmith keegancsmith requested a review from a team September 14, 2023 11:01
@keegancsmith keegancsmith marked this pull request as ready for review September 14, 2023 11:01
@keegancsmith keegancsmith merged commit bdc0413 into main Sep 14, 2023
@keegancsmith keegancsmith deleted the k/use-errorhook branch September 14, 2023 12:40
@keegancsmith
Copy link
Member Author

@DaedalusG fix for the nil panic is now in main :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants