mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-09 09:09:03 +03:00
refactor: improve error handle (#195)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use anyhow::{anyhow, bail, Result};
|
||||
use anyhow::{bail, Context, Result};
|
||||
use clap::builder::PossibleValuesParser;
|
||||
use clap::{value_parser, Arg, ArgAction, ArgMatches, Command};
|
||||
use clap_complete::{generate, Generator, Shell};
|
||||
@@ -380,7 +380,7 @@ impl Args {
|
||||
p.push(path); // If path is absolute, it replaces the current path.
|
||||
std::fs::canonicalize(p)
|
||||
})
|
||||
.map_err(|err| anyhow!("Failed to access path `{}`: {}", path.display(), err,))
|
||||
.with_context(|| format!("Failed to access path `{}`", path.display()))
|
||||
}
|
||||
|
||||
fn parse_assets_path<P: AsRef<Path>>(path: P) -> Result<PathBuf> {
|
||||
|
||||
Reference in New Issue
Block a user