1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum LuaError {
8 #[error("lua error: {0}")]
10 Runtime(#[from] mlua::Error),
11
12 #[error("script not found: {0}")]
14 ScriptNotFound(String),
15
16 #[error("invalid script: {0}")]
18 InvalidScript(String),
19
20 #[error("missing callback: {0}")]
22 MissingCallback(String),
23
24 #[error("type error: {0}")]
26 TypeError(String),
27
28 #[error("init failed: {0}")]
30 InitFailed(String),
31}
32
33impl From<LuaError> for orcs_component::ComponentError {
34 fn from(err: LuaError) -> Self {
35 orcs_component::ComponentError::ExecutionFailed(err.to_string())
36 }
37}