Add common failure cases for rpc server connection failure

This commit is contained in:
instagibbs 2016-11-03 09:56:26 -04:00 committed by Jack Grigg
parent 32f4e7744c
commit 603205e381
No known key found for this signature in database
GPG Key ID: 6A6914DAFBEA00DA
1 changed files with 1 additions and 1 deletions

View File

@ -236,7 +236,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)