use mlua::Error as LuaError;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum SearchError {
#[error("Scene search error: {0}")]
SceneTableError(#[from] pasta_core::SceneTableError),
#[error("Word search error: {0}")]
WordTableError(#[from] pasta_core::WordTableError),
#[error("Invalid argument: {0}")]
InvalidArgument(String),
#[error("Lua error: {0}")]
LuaError(#[from] LuaError),
}
impl From<SearchError> for LuaError {
fn from(err: SearchError) -> Self {
match err {
SearchError::LuaError(e) => e,
other => LuaError::RuntimeError(other.to_string()),
}
}
}