mirror of
https://github.com/winapps-org/winapps.git
synced 2025-06-05 22:57:19 +02:00
Add more error messages
This commit is contained in:
parent
b851935e08
commit
28ea1de08d
@ -60,12 +60,12 @@ pub fn load_config(path: Option<&str>) -> Config {
|
||||
let mut config_file =
|
||||
File::create(&config_file).expect("Failed to create configuration file");
|
||||
|
||||
let gen_config = toml::to_string(&config).unwrap();
|
||||
let gen_config = toml::to_string(&config).except("Failed to generate default configuration");
|
||||
write!(config_file, "{}", gen_config).expect("Failed to write configuration file");
|
||||
}
|
||||
|
||||
let config_file = fs::read_to_string(config_file).expect("Failed to read configuration file");
|
||||
let config: Config = toml::from_str(config_file.as_str()).unwrap();
|
||||
let config: Config = toml::from_str(config_file.as_str()).expect("Failed to parse the configuration");
|
||||
|
||||
config
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user