diff options
author | Christian Decker <decker.christian@gmail.com> | 2021-03-23 14:39:25 +0100 |
---|---|---|
committer | Christian Decker <decker.christian@gmail.com> | 2021-06-03 11:23:22 +0200 |
commit | f76cb10d7dc9a7b0c55d28011161606399417664 (patch) | |
tree | f07c3214ae0a48cfc7a3f69ec08d096777df493e /src | |
parent | c490e17ef698a1695050f82ef6567b3b87a21861 (diff) | |
download | bitcoin-f76cb10d7dc9a7b0c55d28011161606399417664.tar.xz |
rpc: Prefix rpcwaittimeout error with details on its nature
As proposed by @laanwj the error message is now prefixed with the
"timeout on transient error:" prefix, to explain why the error is
suddenly considered terminal.
Diffstat (limited to 'src')
-rw-r--r-- | src/bitcoin-cli.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 3f96963d94..adc485983f 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -809,12 +809,12 @@ static UniValue ConnectAndCallRPC(BaseRequestHandler* rh, const std::string& str } } break; // Connection succeeded, no need to retry. - } catch (const CConnectionFailed&) { + } catch (const CConnectionFailed& e) { const int64_t now = GetTime<std::chrono::seconds>().count(); if (fWait && (timeout <= 0 || now < deadline)) { UninterruptibleSleep(std::chrono::seconds{1}); } else { - throw; + throw CConnectionFailed(strprintf("timeout on transient error: %s", e.what())); } } } while (fWait); |