mirror of
https://github.com/lune-org/lune.git
synced 2025-04-10 21:40:54 +01:00
replace runtime err with require err
This commit is contained in:
parent
9414a9fc29
commit
1708c05522
1 changed files with 3 additions and 5 deletions
|
@ -58,11 +58,9 @@ pub async fn lua_require(lua: &Lua, path: String) -> LuaResult<LuaMultiValue> {
|
||||||
let require_path_abs = resolve_path(&parent_path.join(&require_path_rel))
|
let require_path_abs = resolve_path(&parent_path.join(&require_path_rel))
|
||||||
.await
|
.await
|
||||||
.map_err(|_| {
|
.map_err(|_| {
|
||||||
LuaError::runtime(format!(
|
RequireError::InvalidRequire(require_path_rel.to_string_lossy().to_string())
|
||||||
"Can not require '{}' as it does not exist",
|
})
|
||||||
require_path_rel.to_string_lossy(),
|
.into_lua_err()?;
|
||||||
))
|
|
||||||
})?;
|
|
||||||
|
|
||||||
context::RequireContext::require(lua, require_path_rel, require_path_abs)
|
context::RequireContext::require(lua, require_path_rel, require_path_abs)
|
||||||
.await
|
.await
|
||||||
|
|
Loading…
Add table
Reference in a new issue