rbx_loader: report script errors
This commit is contained in:
@@ -5,6 +5,7 @@ use strafesnet_common::map::CompleteMap;
|
||||
use strafesnet_deferred_loader::deferred_loader::{LoadFailureMode,MeshDeferredLoader,RenderConfigDeferredLoader};
|
||||
|
||||
pub use error::RecoverableErrors;
|
||||
pub use roblox_emulator::runner::Error as RunnerError;
|
||||
|
||||
mod rbx;
|
||||
mod mesh;
|
||||
@@ -52,16 +53,18 @@ impl Place{
|
||||
context,
|
||||
})
|
||||
}
|
||||
pub fn run_scripts(&mut self){
|
||||
pub fn run_scripts(&mut self)->Result<Vec<RunnerError>,RunnerError>{
|
||||
let Place{context}=self;
|
||||
let runner=roblox_emulator::runner::Runner::new().unwrap();
|
||||
let runner=roblox_emulator::runner::Runner::new()?;
|
||||
let scripts=context.scripts();
|
||||
let runnable=runner.runnable_context(context).unwrap();
|
||||
let runnable=runner.runnable_context(context)?;
|
||||
let mut errors=Vec::new();
|
||||
for script in scripts{
|
||||
if let Err(e)=runnable.run_script(script){
|
||||
println!("runner error: {e}");
|
||||
errors.push(e);
|
||||
}
|
||||
}
|
||||
Ok(errors)
|
||||
}
|
||||
pub fn to_snf(&self,failure_mode:LoadFailureMode)->Result<(CompleteMap,RecoverableErrors),LoadError>{
|
||||
to_snf(self,failure_mode)
|
||||
|
||||
Reference in New Issue
Block a user