print errors better
This commit is contained in:
parent
5a1df16bd9
commit
6c12bc2bf6
@ -16,8 +16,8 @@ pub enum Error{
|
||||
impl std::fmt::Display for Error{
|
||||
fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{
|
||||
match self{
|
||||
Self::Lua{source,error:mlua::Error::RuntimeError(s)}=>write!(f,"lua error: {s}\nsource:{source}"),
|
||||
Self::RustLua(mlua::Error::RuntimeError(s))=>write!(f,"rust-side lua error: {s}"),
|
||||
Self::Lua{source,error}=>write!(f,"lua error: source:\n{source}\n{error}"),
|
||||
Self::RustLua(error)=>write!(f,"rust-side lua error: {error}"),
|
||||
other=>write!(f,"{other:?}"),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user