-
Notifications
You must be signed in to change notification settings - Fork 38.7k
bitcoin-cli: Make error message less confusing #9265
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
Conversation
Sorry for the churn on this, but the current message (introduced in bitcoin#9073) isn't acceptable: $ src/bitcoin-cli getinfo rpc: couldn't connect to server (make sure server is running and you are connecting to the correct RPC port: -1 unknown) Putting the error code after the words "RPC port" made me wonder whether there was a port configuration issue. This changes it to: $ src/bitcoin-cli getinfo error: couldn't connect to server: unknown (code -1) (make sure server is running and you are connecting to the correct RPC port)
|
Somehow, I'd expect to see the string "Connection refused" somewhere in the output, but this makes it a bit clearer, yes: ACK fe37fbe |
|
I'm not aware of any way of getting the underlying error OS error code from
libevent. The one shown is libevent http error and every network layer
error will basically get -1. But feel free to suggest a way.
The other alternative would be to revert #9073 and leave it at that.
|
|
This prints the message I want to see: |
|
But that's cheating - you have no idea at that point whether the underlying error was really "connection refused". It could just as well be some other network-layer error. Printing a potentially false error would be worse for troubleshooting than not doing anything. |
|
utACK fe37fbe |
|
@laanwj Right. libevent hides the exact issue from us. |
|
utACK fe37fbe |
fe37fbe bitcoin-cli: Make error message less confusing (Wladimir J. van der Laan)
|
Bonjour |
libevent-based http server Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#5677 - bitcoin/bitcoin#6695 - bitcoin/bitcoin#6899 - bitcoin/bitcoin#7016 - bitcoin/bitcoin#7964 - bitcoin/bitcoin#8722 - bitcoin/bitcoin#8730 - bitcoin/bitcoin#9073 - bitcoin/bitcoin#9265 - bitcoin/bitcoin#9387 - bitcoin/bitcoin#9471 - bitcoin/bitcoin#9647 - bitcoin/bitcoin#9903 Closes #1593 and #1856.
libevent-based http server Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#5677 - bitcoin/bitcoin#6695 - bitcoin/bitcoin#6899 - bitcoin/bitcoin#7016 - bitcoin/bitcoin#7964 - bitcoin/bitcoin#8722 - bitcoin/bitcoin#8730 - bitcoin/bitcoin#9073 - bitcoin/bitcoin#9265 - bitcoin/bitcoin#9387 - bitcoin/bitcoin#9471 - bitcoin/bitcoin#9647 - bitcoin/bitcoin#9903 - bitcoin/bitcoin#6640 - bitcoin/bitcoin#8139 - bitcoin/bitcoin#8839 Closes #1593 and #1856.
fe37fbe bitcoin-cli: Make error message less confusing (Wladimir J. van der Laan)
fe37fbe bitcoin-cli: Make error message less confusing (Wladimir J. van der Laan)
fe37fbe bitcoin-cli: Make error message less confusing (Wladimir J. van der Laan)
Sorry for the churn on this, but the current message (introduced in #9073) isn't acceptable:
Putting the error code after the words "RPC port" made me wonder whether there was a port configuration issue.
This changes it to: