Provide error message when image is not found
This commit is contained in:
parent
be2204af7e
commit
f73b13d512
1 changed files with 2 additions and 1 deletions
|
|
@ -21,7 +21,8 @@ fn model(app: &App) -> Model {
|
|||
.unwrap();
|
||||
|
||||
let file = env::args().nth(1).ok_or("Please give me a file!").unwrap();
|
||||
let image = image::open(file).unwrap();
|
||||
let image =
|
||||
image::open(file).expect(format!("Could not open image, please check the path.").as_str());
|
||||
|
||||
Model { image }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue