aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2024-04-02 11:12:18 +0100
committerfanquake <fanquake@gmail.com>2024-04-02 11:20:38 +0100
commitc407caa2972191d6a795228fd4bcdcd4be41d4a7 (patch)
treec9fa5a81fe9d86be472a7236fdbecee2d1f24b7b /src
parent1d8a5f0d9bd00d0f585d77b8e70a3e51fda79cb9 (diff)
parent69d6fd676e9c15ef41a03722d51ed0b13c3e4320 (diff)
downloadbitcoin-c407caa2972191d6a795228fd4bcdcd4be41d4a7.tar.xz
Merge bitcoin/bitcoin#29687: cli: improve bitcoin-cli error when not connected
69d6fd676e9c15ef41a03722d51ed0b13c3e4320 cli: improve bitcoin-cli error when not connected (willcl-ark) Pull request description: Closes: #29555 Simply adds an additional suggestion to check `bitcoin-cli -help`. ACKs for top commit: maflcko: lgtm ACK 69d6fd676e9c15ef41a03722d51ed0b13c3e4320 itornaza: tested ACK 69d6fd676e9c15ef41a03722d51ed0b13c3e4320 tdb3: ACK for 69d6fd676e9c15ef41a03722d51ed0b13c3e4320 Tree-SHA512: af0c712bcc9b1267f81a8316d015bef99ab788ef43e3b450cdc4a9cb74004727d757d48f50d3af2b28b01be2931578623311677a79f1b148a53f364bd4279a0c
Diffstat (limited to 'src')
-rw-r--r--src/bitcoin-cli.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
index f0e27cb675..129deeec60 100644
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -827,7 +827,10 @@ static UniValue CallRPC(BaseRequestHandler* rh, const std::string& strMethod, co
if (response.error != -1) {
responseErrorMessage = strprintf(" (error code %d - \"%s\")", response.error, http_errorstring(response.error));
}
- 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));
+ throw CConnectionFailed(strprintf("Could not connect to the server %s:%d%s\n\n"
+ "Make sure the bitcoind server is running and that you are connecting to the correct RPC port.\n"
+ "Use \"bitcoin-cli -help\" for more info.",
+ host, port, responseErrorMessage));
} else if (response.status == HTTP_UNAUTHORIZED) {
if (failedToGetAuthCookie) {
throw std::runtime_error(strprintf(