-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enrich early EOF
error message
#410
Conversation
The new make target creates an env file that can be used for debugging purposes. Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
3197086
to
7cc4085
Compare
controllers/git_test.go
Outdated
|
||
err = push(context.TODO(), repo.Workdir(), "test", access) | ||
g.Expect(err).To(HaveOccurred()) | ||
g.Expect(err.Error()).To(ContainSubstring("early EOF")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this test is supposed to test the enrichment of the "early EOF" error messages, it'd make more sense to check for the additional message that we explicitly add.
if err.Error() == "early EOF" { | ||
return fmt.Errorf("early EOF (the SSH key may not have write access to the repository)") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this would be better?
if err.Error() == "early EOF" { | |
return fmt.Errorf("early EOF (the SSH key may not have write access to the repository)") | |
} | |
if strings.Contains(err.Error(), "early EOF") { | |
return fmt.Errorf("%w (the SSH key may not have write access to the repository)", err) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @pjbgf
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! 💯
Some Git servers may close the connection abruptly when the user does not have write access to a repository whilst trying to do a push operation. The result for the end users is an
early EOF
message, which is not very helpful.This PR changes the error message to:
early EOF (the SSH key may not have write access to the repository)
.Fixes #405.