fix(lua): new errors

This commit is contained in:
əlemi 2024-09-01 03:09:35 +02:00 committed by zaaarf
parent cf1e910dcb
commit 840da7bf5a
No known key found for this signature in database
GPG key ID: 102E445F4C3F829B

View file

@ -8,12 +8,21 @@ use crate::workspace::worker::DetachResult;
use mlua::prelude::*;
use tokio::sync::mpsc;
impl From::<CodempError> for LuaError {
fn from(value: CodempError) -> Self {
LuaError::WithContext {
context: value.to_string(),
cause: std::sync::Arc::new(LuaError::external(value)),
}
impl From::<crate::errors::ConnectionError> for LuaError {
fn from(value: crate::errors::ConnectionError) -> Self {
LuaError::runtime(value.to_string())
}
}
impl From::<crate::errors::ProcedureError> for LuaError {
fn from(value: crate::errors::ProcedureError) -> Self {
LuaError::runtime(value.to_string())
}
}
impl From::<crate::errors::ControllerError> for LuaError {
fn from(value: crate::errors::ControllerError) -> Self {
LuaError::runtime(value.to_string())
}
}