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

Retain context of deploy push errors #601

Merged
merged 1 commit into from
Jul 5, 2022

Conversation

itowlson
Copy link
Contributor

If a deployment fails due to a bindle push error (e.g. wrong URL), the error and immediate cause are printed on one line:

$ BINDLE_URL=bin spin deploy
Error: Failed to push bindle to server Failed to create a bindle client for server 'bin'

This PR proposes to use an anyhow context instead, which provides more formatting but also retains additional layers of context:

$ BINDLE_URL=bin spin deploy
Error: Failed to push bindle werwrwer/0.1.1+qfef7776 to server bin

Caused by:
    0: Failed to create a bindle client for server 'bin'
    1: Invalid URL given
    2: relative URL without a base

$ BINDLE_URL=http://bin spin deploy
Error: Failed to push bindle werwrwer/0.1.1+qfef7776 to server http://bin

Caused by:
    0: Failed to push bindle from '/tmp/.tmpb3VXG7' to server at 'http://bin'
    1: Error creating request
    2: error sending request for url (http://bin/_i): error trying to connect: dns error: failed to lookup address information: No address associated with hostname
    3: error trying to connect: dns error: failed to lookup address information: No address associated with hostname
    4: dns error: failed to lookup address information: No address associated with hostname
    5: failed to lookup address information: No address associated with hostname

I'm not sure if this much context is really right - I do think some measure of diagnostic info is good but this might be too "internal" looking for a user experience. In which case I'm happy to put it back to how it was before except with a newline grin.

Signed-off-by: itowlson <ivan.towlson@fermyon.com>
@itowlson itowlson requested a review from michelleN June 26, 2022 21:51
@itowlson itowlson merged commit ee49e0f into fermyon:main Jul 5, 2022
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.

2 participants