Log certain errors better

This commit is contained in:
Omar Abdulla
2025-07-16 19:08:22 +03:00
parent baa11ad28f
commit 3bce1b1545
+22 -1
View File
@@ -219,7 +219,17 @@ where
continue; continue;
}; };
let nonce = node.fetch_add_nonce(input.caller)?; let nonce = match node.fetch_add_nonce(input.caller) {
Ok(nonce) => nonce,
Err(error) => {
tracing::error!(
caller = ?input.caller,
?error,
"Failed to get the nonce for the caller"
);
return Err(error);
}
};
tracing::debug!( tracing::debug!(
"Calculated nonce {}, for contract {}, having address {} on node: {}", "Calculated nonce {}, for contract {}, having address {} on node: {}",
@@ -232,6 +242,17 @@ where
// We are using alloy for building and submitting the transactions and it will // We are using alloy for building and submitting the transactions and it will
// automatically fill in all of the missing fields from the provider that we // automatically fill in all of the missing fields from the provider that we
// are using. // are using.
let code = match alloy::hex::decode(&code) {
Ok(code) => code,
Err(error) => {
tracing::error!(
code,
?error,
"Failed to hex-decode the code of the contract. (This could possibly mean that it contains '_' and therefore it requires linking to be performed)"
);
return Err(error.into());
}
};
let code = alloy::hex::decode(&code)?; let code = alloy::hex::decode(&code)?;
let tx = TransactionRequest::default() let tx = TransactionRequest::default()
.nonce(nonce) .nonce(nonce)