Support for errors from scripts through separate script error handling.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,6 +1,17 @@
|
||||
use std::ffi::{c_char, CString};
|
||||
|
||||
/// The foreign function interfaces for the turn choices
|
||||
mod choices;
|
||||
/// The foreign function interfaces for the dynamic data libraries
|
||||
mod libraries;
|
||||
/// The foreign function interfaces for the dynamic data models
|
||||
mod models;
|
||||
|
||||
/// The library the battle uses for handling.
|
||||
#[no_mangle]
|
||||
#[allow(clippy::unwrap_used)]
|
||||
extern "C" fn set_script_error_handler(func: unsafe extern "C" fn(*mut c_char)) {
|
||||
crate::dynamic_data::set_script_error_handler(Box::new(move |e: &anyhow_ext::Error| unsafe {
|
||||
func(CString::new(e.to_string()).unwrap().into_raw())
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user