mirror of
https://github.com/lune-org/lune.git
synced 2025-04-10 21:40:54 +01:00
better error message
This commit is contained in:
parent
35f24228cc
commit
42f5688993
1 changed files with 3 additions and 3 deletions
|
@ -27,11 +27,11 @@ pub enum LuaurcError {
|
||||||
FailedStringToPathConversion,
|
FailedStringToPathConversion,
|
||||||
#[error("Failed to find a path for alias '{0}' in .luaurc files")]
|
#[error("Failed to find a path for alias '{0}' in .luaurc files")]
|
||||||
FailedToFindAlias(String),
|
FailedToFindAlias(String),
|
||||||
|
#[error("Failed to parse {0}\nParserError: {1}")]
|
||||||
|
FilaedToParse(PathBuf, serde_json::Error),
|
||||||
|
|
||||||
#[error("IOError: {0}")]
|
#[error("IOError: {0}")]
|
||||||
IOError(#[from] std::io::Error),
|
IOError(#[from] std::io::Error),
|
||||||
#[error("JsonError: {0}")]
|
|
||||||
JsonError(#[from] serde_json::Error),
|
|
||||||
#[error("LuaError: {0}")]
|
#[error("LuaError: {0}")]
|
||||||
LuaError(#[from] mlua::Error),
|
LuaError(#[from] mlua::Error),
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ async fn parse_luaurc(_: &mlua::Lua, path: &PathBuf) -> Result<Option<Luaurc>, L
|
||||||
let content = fs::read(path).await?;
|
let content = fs::read(path).await?;
|
||||||
serde_json::from_slice(&content)
|
serde_json::from_slice(&content)
|
||||||
.map(Some)
|
.map(Some)
|
||||||
.map_err(std::convert::Into::into)
|
.map_err(|err| LuaurcError::FilaedToParse(path.clone(), err))
|
||||||
} else {
|
} else {
|
||||||
Ok(None)
|
Ok(None)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue