diff --git a/vm/actor/src/builtin/miner/mod.rs b/vm/actor/src/builtin/miner/mod.rs index be59d3491b80..cd6dc57af497 100644 --- a/vm/actor/src/builtin/miner/mod.rs +++ b/vm/actor/src/builtin/miner/mod.rs @@ -2652,7 +2652,9 @@ impl Actor { rt.curr_epoch(), &rt.current_balance()?, ) - .map_err(|e| actor_error!(ErrIllegalState, "failed to repay penalty: {}", e))?; + .map_err(|e| { + e.downcast_default(ExitCode::ErrIllegalState, "failed to repay penalty") + })?; pledge_delta_total -= &penalty_from_vesting; let to_burn = penalty_from_vesting + penalty_from_balance; Ok((pledge_delta_total, to_burn)) @@ -3053,7 +3055,9 @@ where rt.curr_epoch(), &rt.current_balance()?, ) - .map_err(|e| actor_error!(ErrIllegalState, "failed to repay penalty: {}", e))?; + .map_err(|e| { + e.downcast_default(ExitCode::ErrIllegalState, "failed to repay penalty") + })?; penalty = &penalty_from_vesting + penalty_from_balance; pledge_delta -= penalty_from_vesting; @@ -3156,7 +3160,9 @@ where rt.curr_epoch(), &rt.current_balance()?, ) - .map_err(|e| actor_error!(ErrIllegalState, "failed to unlock penalty: {}", e))?; + .map_err(|e| { + e.downcast_default(ExitCode::ErrIllegalState, "failed to unlock penalty") + })?; penalty_total = &penalty_from_vesting + penalty_from_balance; pledge_delta_total -= penalty_from_vesting;