浏览代码

[Convert] Report file name when raising an error

Slava Barinov 2 年之前
父节点
当前提交
9eb610026d
共有 1 个文件被更改,包括 1 次插入1 次删除
  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)
 }