mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 23:34:49 +01:00
fix(lua): new errors
This commit is contained in:
parent
cf1e910dcb
commit
840da7bf5a
1 changed files with 15 additions and 6 deletions
|
@ -8,13 +8,22 @@ use crate::workspace::worker::DetachResult;
|
||||||
use mlua::prelude::*;
|
use mlua::prelude::*;
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
|
|
||||||
impl From::<CodempError> for LuaError {
|
impl From::<crate::errors::ConnectionError> for LuaError {
|
||||||
fn from(value: CodempError) -> Self {
|
fn from(value: crate::errors::ConnectionError) -> Self {
|
||||||
LuaError::WithContext {
|
LuaError::runtime(value.to_string())
|
||||||
context: value.to_string(),
|
|
||||||
cause: std::sync::Arc::new(LuaError::external(value)),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tokio() -> &'static tokio::runtime::Runtime {
|
fn tokio() -> &'static tokio::runtime::Runtime {
|
||||||
|
|
Loading…
Reference in a new issue