Skip to content

Commit f76cb10

Browse files
committed
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.
1 parent c490e17 commit f76cb10

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bitcoin-cli.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,12 +809,12 @@ static UniValue ConnectAndCallRPC(BaseRequestHandler* rh, const std::string& str
809809
}
810810
}
811811
break; // Connection succeeded, no need to retry.
812-
} catch (const CConnectionFailed&) {
812+
} catch (const CConnectionFailed& e) {
813813
const int64_t now = GetTime<std::chrono::seconds>().count();
814814
if (fWait && (timeout <= 0 || now < deadline)) {
815815
UninterruptibleSleep(std::chrono::seconds{1});
816816
} else {
817-
throw;
817+
throw CConnectionFailed(strprintf("timeout on transient error: %s", e.what()));
818818
}
819819
}
820820
} while (fWait);

0 commit comments

Comments
 (0)