From f76cb10d7dc9a7b0c55d28011161606399417664 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 23 Mar 2021 14:39:25 +0100 Subject: 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. --- src/bitcoin-cli.cpp | 4 ++-- 1 file 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().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); -- cgit v1.2.3