mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-23 15:25:43 +02: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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user