We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 13eb108 commit 23a5030Copy full SHA for 23a5030
src/simulation/config.rs
@@ -26,7 +26,12 @@ pub struct Config {
26
27
impl Config {
28
pub fn from_file(args: &CommandLineArgs) -> Self {
29
- let reader = BufReader::new(File::open(&args.config_path).expect("Failed to open file."));
+ let reader = BufReader::new(File::open(&args.config_path).unwrap_or_else(|e| {
30
+ panic!(
31
+ "Failed to open config file at {}. Original error was {}",
32
+ args.config_path, e
33
+ );
34
+ }));
35
let mut config: Config = serde_yaml::from_reader(reader).unwrap_or_else(|e| {
36
panic!(
37
"Failed to parse config at {}. Original error was: {}",
0 commit comments