Closes: #29555
Simply adds an additional suggestion to check bitcoin-cli -help
.
Closes: #29555
Simply adds an additional suggestion to check bitcoin-cli -help
.
Adds a string suggestion `bitcoin-cli -help` as an additional source of
information.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For detailed information about the code coverage, see the test coverage report.
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
826@@ -827,7 +827,10 @@ static UniValue CallRPC(BaseRequestHandler* rh, const std::string& strMethod, co
827 if (response.error != -1) {
828 responseErrorMessage = strprintf(" (error code %d - \"%s\")", response.error, http_errorstring(response.error));
829 }
830- throw CConnectionFailed(strprintf("Could not connect to the server %s:%d%s\n\nMake sure the bitcoind server is running and that you are connecting to the correct RPC port.", host, port, responseErrorMessage));
831+ throw CConnectionFailed(strprintf("Could not connect to the server %s:%d%s\n\n"
832+ "Make sure the bitcoind server is running and that you are connecting to the correct RPC port.\n"
833+ "Use \"bitcoin-cli -help\" for more info.",
834+ host, port, responseErrorMessage));
3 tabs eh? :)
I suggest conforming with the throw
-statement following the one being changed - putting the initial string literal on a new line and keep to one tab indentation.
0 throw CConnectionFailed(strprintf(
1 "Could not connect to the server %s:%d%s\n\n"
2 "Make sure the bitcoind server is running and that you are connecting to the correct RPC port.\n"
3 "Use \"bitcoin-cli -help\" for more info.",
4 host, port, responseErrorMessage));
clang-format-diff has other ideas:
0 throw CConnectionFailed(strprintf("Could not connect to the server %s:%d%s\n\n"
1 "Make sure the bitcoind server is running and that you are connecting to the correct RPC port.\n"
2 "Use \"bitcoin-cli -help\" for more info.",
3 host, port, responseErrorMessage));
Not sure where the 3 tabs came from, as my check script is supposed to run that… I guess was my editor default somehow though.
\t
are not allowed in C++ code in this repo. If there were any, the CI should have failed.
826@@ -827,7 +827,10 @@ static UniValue CallRPC(BaseRequestHandler* rh, const std::string& strMethod, co
827 if (response.error != -1) {
828 responseErrorMessage = strprintf(" (error code %d - \"%s\")", response.error, http_errorstring(response.error));
829 }
830- throw CConnectionFailed(strprintf("Could not connect to the server %s:%d%s\n\nMake sure the bitcoind server is running and that you are connecting to the correct RPC port.", host, port, responseErrorMessage));
831+ throw CConnectionFailed(strprintf("Could not connect to the server %s:%d%s\n\n"
832+ "Make sure the bitcoind server is running and that you are connecting to the correct RPC port.\n"
833+ "Use \"bitcoin-cli -help\" for more info.",
nit: ++specificity
0 "Use \"bitcoin-cli -help\" for more connection info.",
-rpcport
, -rpcconnect
or -signet
(different default port), but not -generate
-netinfo
or -stdin
. Maybe -signet
is not something one would classify as “connection info” though, making it less accurate as you say.
ACK for 69d6fd676e9c15ef41a03722d51ed0b13c3e4320
Good light-touch approach to address Issue #29555. Executed, and the output looks good:
0$ src/bitcoin-cli help
1error: timeout on transient error: Could not connect to the server 127.0.0.1:8332
2
3Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
4Use "bitcoin-cli -help" for more info.
Just to be thorough: Pulled the pr branch, built, ran all unit and functional tests (all passed) before executing.
tested ACK 69d6fd676e9c15ef41a03722d51ed0b13c3e4320
This a reasonable way for both reporting the connection failure, plus guiding the user on how to get more help on bitcoin-cli.
bitcoind
already running is confirmed:0% src/bitcoin-cli help
1error: timeout on transient error: Could not connect to the server 127.0.0.1:18332
2
3Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
4Use "bitcoin-cli -help" for more info.
--with-incompatible-bdb
and --enable-suppress-external-warnings
make check
and all tests passtest/functional/test_runner.py --extended
and all tests pass