mirror of
https://github.com/lune-org/lune.git
synced 2025-04-04 10:30: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,
|
||||
#[error("Failed to find a path for alias '{0}' in .luaurc files")]
|
||||
FailedToFindAlias(String),
|
||||
#[error("Failed to parse {0}\nParserError: {1}")]
|
||||
FilaedToParse(PathBuf, serde_json::Error),
|
||||
|
||||
#[error("IOError: {0}")]
|
||||
IOError(#[from] std::io::Error),
|
||||
#[error("JsonError: {0}")]
|
||||
JsonError(#[from] serde_json::Error),
|
||||
#[error("LuaError: {0}")]
|
||||
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?;
|
||||
serde_json::from_slice(&content)
|
||||
.map(Some)
|
||||
.map_err(std::convert::Into::into)
|
||||
.map_err(|err| LuaurcError::FilaedToParse(path.clone(), err))
|
||||
} else {
|
||||
Ok(None)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue