Skip to content

Commit 6c24671

Browse files
Merge bitcoin#29687: cli: improve bitcoin-cli error when not connected
Co-authored-by: fanquake <fanquake@gmail.com>
1 parent 4f1d6e7 commit 6c24671

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/bitcoin-cli.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,10 @@ static UniValue CallRPC(BaseRequestHandler* rh, const std::string& strMethod, co
828828
if (response.error != -1) {
829829
responseErrorMessage = strprintf(" (error code %d - \"%s\")", response.error, http_errorstring(response.error));
830830
}
831-
throw CConnectionFailed(strprintf("Could not connect to the server %s:%d%s\n\nMake sure the dashd 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 dashd server is running and that you are connecting to the correct RPC port.\n"
833+
"Use \"dash-cli -help\" for more info.",
834+
host, port, responseErrorMessage));
832835
} else if (response.status == HTTP_UNAUTHORIZED) {
833836
if (failedToGetAuthCookie) {
834837
throw std::runtime_error(strprintf(

0 commit comments

Comments
 (0)