You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Return a more structured error for submit_and_wait_bcs instead of Unknown(anyhow::Error) when transaction failed.
Motivation
Currently submit_and_wait_bcs will return Unknown(anyhow::Error) when transaction failed, which I can only use Regexp to match the string part to identify the actually error.
match result {Ok(tx_data) => {}Err(RestError::Unknown(e))if e.to_string().contains(INSUFFICIENT_BALANCE) => {}Err(RestError::Unknown(e))if e.to_string().contains(TOO_MANY_STEPS) => {}
Pitch
I hope the error can hold something like ExecutionStatus
match resp.info.status() {
ExecutionStatus::Success => {}
ExecutionStatus::OutOfGas => {}
ExecutionStatus::MoveAbort { code, info, .. } => match info {
}
_ => {}
}
}
The text was updated successfully, but these errors were encountered:
fgfm999
changed the title
[Feature Request] Return more structured for submit_and_wait_bcs when ransaction failed.
[Feature Request] Return more structured error for submit_and_wait_bcs when transaction failed.
Dec 30, 2024
🚀 Feature Request
Return a more structured error for
submit_and_wait_bcs
instead ofUnknown(anyhow::Error)
when transaction failed.Motivation
Currently
submit_and_wait_bcs
will returnUnknown(anyhow::Error)
when transaction failed, which I can only use Regexp to match the string part to identify the actually error.Pitch
I hope the error can hold something like
ExecutionStatus
The text was updated successfully, but these errors were encountered: