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
Improve error message when supervisor unavailable #5465
Conversation
This fixes #5367. Previously, when doing a `hab svc (load|unload)`, or any command that requires remote control of the supervisor, if there was a network issue, we would simply return the upstream description of the problem (most often, something like `Connection refused (os error 111)`. This wasn't a very user friendly error message. Now, on any `SvcClient` command that returns an `SvcClientError::Io` error, we will print the following: ``` ✗✗✗ ✗✗✗ Unable to contact the Supervisor. ✗✗✗ ✗✗✗ If the Supervisor you are contacting is local, this probably means it is not running. You can run a Supervisor in the foreground with: ✗✗✗ ✗✗✗ hab sup run ✗✗✗ ✗✗✗ Or try restarting the Supervisor through your oerating systems init process. ✗✗✗ ✗✗✗ Original error is: ✗✗✗ ✗✗✗ Connection refused (os error 111) ✗✗✗ ``` Which is, I think, much more helpful. Signed-off-by: Adam Jacob <adam@chef.io>
Thanks for the pull request! Here is what will happen next:
Thank you for contributing! |
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.
OMG This will make things SO much better!
components/sup-client/src/lib.rs
Outdated
"Unable to contact the Supervisor.\n\n\ | ||
If the Supervisor you are contacting is local, this probably means it is not running. You can run a Supervisor in the foreground with:\n\n\ | ||
hab sup run\n\n\ | ||
Or try restarting the Supervisor through your oerating systems init process.\n\n\ |
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.
oerating
-> operating
init process
-> init process or Windows service
Windows users will not likely be familiar with the term init process
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.
systems
-> system's
, too
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.
Good to go after some typo fixes.
This is a nice improvement! I think we could go even one better by checking whether there is a supervisor running locally and/or whether a |
Signed-off-by: Jon Bauman <5906042+baumanj@users.noreply.github.com>
Obvious fix; these changes are the result of automation not creative thinking.
Hey guys! It's been a while since I've suggested that improvement and I would say that it is really great to see that changes are accepted. Such a good community, thank you all! |
This fixes #5367.
Previously, when doing a
hab svc (load|unload)
, or any command thatrequires remote control of the supervisor, if there was a network issue,
we would simply return the upstream description of the problem (most
often, something like
Connection refused (os error 111)
.This wasn't a very user friendly error message. Now, on any
SvcClient
command that returns an
SvcClientError::Io
error, we will print thefollowing:
Which is, I think, much more helpful.
Signed-off-by: Adam Jacob adam@chef.io