mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 22:52:22 +00:00
Improve error message when missing config file
This commit is contained in:
@@ -95,8 +95,9 @@ async fn main() -> Result<()> {
|
|||||||
Some(Command::Pwhash(pwhash_args)) => cmd_pwhash(pwhash_args)?,
|
Some(Command::Pwhash(pwhash_args)) => cmd_pwhash(pwhash_args)?,
|
||||||
None => {
|
None => {
|
||||||
let config: Config = toml::from_str(
|
let config: Config = toml::from_str(
|
||||||
&fs::read_to_string(&args.config_file)
|
&fs::read_to_string(&args.config_file).unwrap_or_else(|err| {
|
||||||
.expect(&format!("No config file found at {}", &args.config_file)),
|
panic!("Could not open file at {}: {}", &args.config_file, err)
|
||||||
|
}),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
setup_tracing(&config.tracing);
|
setup_tracing(&config.tracing);
|
||||||
|
|||||||
Reference in New Issue
Block a user