From a4e2ed7e2fb002b2ba7bf1e036704636a30badf3 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 17 Sep 2024 18:00:17 -0700 Subject: [PATCH] error printing function --- src/script.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/script.rs b/src/script.rs index a17b7ab..360f4d6 100644 --- a/src/script.rs +++ b/src/script.rs @@ -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,