- 移除 anyhow,使用 thiserror 定义强类型 Error 枚举 - 支持 #[from] 自动转换 mlua::Error,关键路径保留源码与上下文 - LuaRuntimeBuilder 采用惰性错误收集,简化链式初始化调用 - MirrorRegistry 实现规范化 FromLuaConversionError 错误转换
15 lines
250 B
Rust
15 lines
250 B
Rust
|
|
pub struct ExecuteError {
|
|
pub code: i32,
|
|
pub source: anyhow::Error,
|
|
}
|
|
|
|
impl ExecuteError {
|
|
pub fn new(code: i32, err: impl Into<anyhow::Error>) -> Self {
|
|
Self {
|
|
code,
|
|
source: err.into(),
|
|
}
|
|
}
|
|
}
|