Browse Source

[Convert] Report file name when raising an error

Slava Barinov 2 years ago
parent
commit
9eb610026d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/convert.rs

+ 1 - 1
src/convert.rs

@@ -9,7 +9,7 @@ use std::fs;
 
 /// Read json file with receipt and convert it into `receipt::Purchase`
 pub fn read_file(f: &str) -> receipt::Purchase {
-    let json = fs::read_to_string(f).expect("Can't read file");
+    let json = fs::read_to_string(f).expect(format!("Can't read file {}", f).as_str());
     receipt::parse_purchase(&json)
 }