diff options
Diffstat (limited to 'src/plugins/factoids/mod.rs')
| -rw-r--r-- | src/plugins/factoids/mod.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/plugins/factoids/mod.rs b/src/plugins/factoids/mod.rs index ba3ee8a..a15b60a 100644 --- a/src/plugins/factoids/mod.rs +++ b/src/plugins/factoids/mod.rs @@ -176,7 +176,10 @@ impl<T: Database> Factoids<T> { } else { match self.run_lua(&name, &content, &command) { Ok(v) => v, - Err(e) => format!("{}", e), + Err(e) => match e { + LuaError::CallbackError { cause, .. } => cause.to_string(), + _ => e.to_string(), + }, } } } else { @@ -187,12 +190,7 @@ impl<T: Database> Factoids<T> { } } - fn run_lua( - &self, - name: &str, - code: &str, - command: &PluginCommand, - ) -> Result<String, rlua::Error> { + fn run_lua(&self, name: &str, code: &str, command: &PluginCommand) -> Result<String, LuaError> { let args = command .tokens .iter() |
