Skip to content
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

Print errors on nelson unit commit failures #29

Merged
merged 1 commit into from
Mar 19, 2020

Conversation

gavinbunney
Copy link
Contributor

@gavinbunney gavinbunney commented Mar 19, 2020

When an empty response is returned from Nelson, users are shown an error without any content:

Unable to commit [email protected] to 'prod'. Response was:

This prints the errors block as part of the message. Doesn't actually fix any errors, but might help to identify if it's a timeout/other transient issue.

Fixes #22

@gavinbunney gavinbunney changed the title Print errors on nelson unit commit failures - fixes #22 Print errors on nelson unit commit failures Mar 19, 2020
@timperrett timperrett merged commit bf7549e into getnelson:master Mar 19, 2020
@@ -540,7 +540,11 @@ func main() {
unitWithVersion := selectedUnitPrefix + "@" + selectedVersion

if e != nil {
return cli.NewExitError("Unable to commit "+unitWithVersion+" to '"+selectedNamespace+"'. Response was:\n"+r, 1)
errors := ""

Choose a reason for hiding this comment

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

Whats going on with the indentation here. Whats the line width here.

for _, ee := range e {
errors += fmt.Sprintf("%s\n", ee.Error())
}
return cli.NewExitError(fmt.Sprintf("Unable to commit %s to '%s'. Response was:\n%s\nErrors:\n%s", unitWithVersion, selectedNamespace, r, errors), 1)

Choose a reason for hiding this comment

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

With errors, can there be an non-empty response ie "r".

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.

while trying to run nelson commit, the response error message printed is empty
3 participants