Skip to content

Commit

Permalink
Handle the panic for pre execution failed
Browse files Browse the repository at this point in the history
  • Loading branch information
steelgeek091 committed Sep 3, 2024
1 parent 030f5f8 commit 1087e46
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions moveos/moveos/src/moveos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,13 @@ impl MoveOS {
if !is_system_call {
// system pre_execute
// we do not charge gas for system_pre_execute function
session
.execute_function_call(self.system_pre_execute_functions.clone(), false)
.expect("system_pre_execute should not fail.");
match session.execute_function_call(self.system_pre_execute_functions.clone(), false) {
Ok(_) => {}
Err(error) => {
log::warn!("System pre execution failed: {:?}", error);
return Err(Error::from(error));
}
}
}

match self.execute_action(&mut session, action.clone()) {
Expand Down

0 comments on commit 1087e46

Please sign in to comment.