Skip to content

Commit f24b7ca

Browse files
cptarturksew1
authored andcommitted
Add error handling
1 parent c032030 commit f24b7ca

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

crates/cheatnet/src/runtime_extensions/native/execution.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::runtime_extensions::call_to_blockifier_runtime_extension::execution::entry_point::{
22
CallInfoWithExecutionData, ContractClassEntryPointExecutionResult,
3+
EntryPointExecutionErrorWithTrace,
34
};
45
use crate::runtime_extensions::native::native_syscall_handler::CheatableNativeSyscallHandler;
56
use crate::state::CheatnetState;
@@ -35,9 +36,11 @@ pub(crate) fn execute_entry_point_call_native(
3536
native_syscall_handler: &mut NativeSyscallHandler::new(call.clone(), state, context),
3637
};
3738

38-
// TODO error handling
3939
let call_info = execute_entry_point_call(call, native_compiled_class_v1, syscall_handler)
40-
.expect("Native execution failed");
40+
.map_err(|err| EntryPointExecutionErrorWithTrace {
41+
source: err,
42+
trace: None,
43+
})?;
4144

4245
Ok(CallInfoWithExecutionData {
4346
call_info,

0 commit comments

Comments
 (0)