error printing function

This commit is contained in:
Quaternions 2024-09-17 18:00:17 -07:00
parent 1a0bb8f8c4
commit a4e2ed7e2f

View File

@ -1,10 +1,21 @@
use rbx_dom_weak::types::Ref;
#[derive(Debug)]
pub enum Error{
Runner(mlua::Error),
NoScript,
NoSource,
}
impl Error{
pub fn print(self){
match self{
Self::Runner(mlua::Error::RuntimeError(s))=>{
println!("lua error: {s:?}");
},
other=>println!("{:?}",other),
}
}
}
pub struct Script{
script:Ref,