1088: feat: add debugging info for failed to fetch transaction r=delta1 a=delta1

Add the jsonrpc error message and data to tracing calls to try debug #1061 "monero-wallet-rpc failed to fetch transaction"

Co-authored-by: Byron Hambly <bhambly@blockstream.com>
This commit is contained in:
bors[bot] 2022-08-03 13:10:10 +00:00 committed by GitHub
commit a9d9250af1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -314,8 +314,13 @@ async fn wait_for_confirmations<C: monero_rpc::wallet::MoneroWalletRpc<reqwest::
.await
{
Ok(proof) => proof,
Err(jsonrpc::Error::JsonRpc(jsonrpc::JsonRpcError { code: -1, .. })) => {
tracing::warn!(%txid, "`monero-wallet-rpc` failed to fetch transaction, may need to be restarted");
Err(jsonrpc::Error::JsonRpc(jsonrpc::JsonRpcError {
code: -1,
message,
data,
})) => {
tracing::debug!(message, ?data);
tracing::warn!(%txid, message, "`monero-wallet-rpc` failed to fetch transaction, may need to be restarted");
continue;
}
// TODO: Implement this using a generic proxy for each function call once https://github.com/thomaseizinger/rust-jsonrpc-client/issues/47 is fixed.