Skip to content

Commit

Permalink
chore: replace unwrap with error (foundry-rs#3502)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Oct 17, 2022
1 parent 1e6505e commit b60deaa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cli/src/cmd/cast/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,14 @@ impl RunArgs {

if let Some(to) = tx.to {
trace!(tx=?tx.hash,?to, "executing previous call transaction");
executor.commit_tx_with_env(env.clone()).unwrap();
executor.commit_tx_with_env(env.clone()).wrap_err_with(|| {
format!("Failed to execute transaction: {:?}", tx.hash())
})?;
} else {
trace!(tx=?tx.hash, "executing previous create transaction");
executor.deploy_with_env(env.clone(), None).unwrap();
executor.deploy_with_env(env.clone(), None).wrap_err_with(|| {
format!("Failed to deploy transaction: {:?}", tx.hash())
})?;
}

update_progress!(pb, index);
Expand Down

0 comments on commit b60deaa

Please sign in to comment.