Skip to content

Commit 224205e

Browse files
committed
Improved error message when setup file not found
1 parent 0137f78 commit 224205e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/bin/lightdock-rust.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,17 @@ fn run() {
115115
};
116116

117117
// Load setup
118-
let setup = read_setup_from_file(setup_filename).unwrap();
118+
let setup = match read_setup_from_file(setup_filename) {
119+
Ok(setup) => setup,
120+
Err(e) => {
121+
eprintln!(
122+
"Error reading setup file [{:?}]: {:?}",
123+
setup_filename,
124+
e.to_string()
125+
);
126+
return;
127+
}
128+
};
119129

120130
// Simulation path
121131
let simulation_path = Path::new(setup_filename).parent().unwrap();

0 commit comments

Comments
 (0)