error printing function
This commit is contained in:
parent
1a0bb8f8c4
commit
a4e2ed7e2f
@ -1,10 +1,21 @@
|
|||||||
use rbx_dom_weak::types::Ref;
|
use rbx_dom_weak::types::Ref;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub enum Error{
|
pub enum Error{
|
||||||
Runner(mlua::Error),
|
Runner(mlua::Error),
|
||||||
NoScript,
|
NoScript,
|
||||||
NoSource,
|
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{
|
pub struct Script{
|
||||||
script:Ref,
|
script:Ref,
|
||||||
|
Loading…
Reference in New Issue
Block a user