Skip to content

Commit

Permalink
Merge #9073: Trivial: Add common failure cases for rpc server connect…
Browse files Browse the repository at this point in the history
…ion failure

8f329f9 Add common failure cases for rpc server connection failure (instagibbs)
  • Loading branch information
laanwj committed Nov 3, 2016
2 parents 3665483 + 8f329f9 commit 82077ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bitcoin-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ UniValue CallRPC(const string& strMethod, const UniValue& params)
event_base_free(base);

if (response.status == 0)
throw CConnectionFailed(strprintf("couldn't connect to server (%d %s)", response.error, http_errorstring(response.error)));
throw CConnectionFailed(strprintf("couldn't connect to server\n(make sure server is running and you are connecting to the correct RPC port: %d %s)", response.error, http_errorstring(response.error)));
else if (response.status == HTTP_UNAUTHORIZED)
throw runtime_error("incorrect rpcuser or rpcpassword (authorization failed)");
else if (response.status >= 400 && response.status != HTTP_BAD_REQUEST && response.status != HTTP_NOT_FOUND && response.status != HTTP_INTERNAL_SERVER_ERROR)
Expand Down

0 comments on commit 82077ef

Please sign in to comment.