mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
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.
This commit is contained in:
parent
c490e17ef6
commit
f76cb10d7d
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue