Skip to content

Commit c2bf65f

Browse files
committed
transmute fatal errors into SYS_ASSERTION_FAILED exit code.
1 parent 26c6f4c commit c2bf65f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

fvm/src/executor/default.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,21 @@ where
138138
}
139139
}
140140
Err(ExecutionError::Fatal(e)) => {
141-
return Err(e.context(format!(
141+
// Annotate the error with the message context.
142+
let _err = e.context(format!(
142143
"[from={}, to={}, seq={}, m={}, h={}] fatal error",
143144
msg.from,
144145
msg.to,
145146
msg.sequence,
146147
msg.method_num,
147148
self.context().epoch
148-
)));
149+
));
150+
// TODO backtrace
151+
Receipt {
152+
exit_code: ExitCode::SYS_ASSERTION_FAILED,
153+
return_data: Default::default(),
154+
gas_used: msg.gas_limit,
155+
}
149156
}
150157
};
151158

0 commit comments

Comments
 (0)