Skip to content

Commit 2b9bb5c

Browse files
authored
BM-232: Added error context for MissingData error (github#55)
Adds the code / message from the RPC when missing data is triggered, this happens if funds are too low or other RPC errors happen.
1 parent 2284788 commit 2b9bb5c

File tree

1 file changed

+3
-3
lines changed
  • crates/boundless-market/src/contracts

1 file changed

+3
-3
lines changed

crates/boundless-market/src/contracts/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ pub enum TxnErr {
338338
#[error("ProofMarket Err: {0:?}")]
339339
ProofMarketErr(IProofMarket::IProofMarketErrors),
340340

341-
#[error("decoding err: missing data")]
342-
MissingData,
341+
#[error("decoding err, missing data, code: {0} msg: {1}")]
342+
MissingData(i64, String),
343343

344344
#[error("decoding err: bytes decoding")]
345345
BytesDecode,
@@ -356,7 +356,7 @@ fn decode_contract_err<T: SolInterface>(err: ContractErr) -> Result<T, TxnErr> {
356356
match err {
357357
ContractErr::TransportError(TransportError::ErrorResp(ts_err)) => {
358358
let Some(data) = ts_err.data else {
359-
return Err(TxnErr::MissingData);
359+
return Err(TxnErr::MissingData(ts_err.code, ts_err.message));
360360
};
361361

362362
let data = data.get().trim_matches('"');

0 commit comments

Comments
 (0)