[DEV-7134] Escalate the error from finding the absolute path

We do not want to have a panic here. The error should be displayed
properly.
master
Joseph Frazer 2020-03-06 11:29:04 -05:00
parent bfea768f89
commit 590245e191
2 changed files with 2 additions and 1 deletions

View File

@ -43,7 +43,7 @@ pub fn main(package_path: &str, output: &str) -> Result<(), Box<dyn Error>> {
let mut roots = Vec::new();
let interner = DefaultInterner::new();
let abs_path = fs::canonicalize(package_path).unwrap();
let abs_path = fs::canonicalize(package_path)?;
println!("WARNING: This is proof-of-concept; do not use!");

View File

@ -61,6 +61,7 @@ fn link_input_file_does_not_exist() -> Result<(), Box<dyn std::error::Error>> {
cmd.arg("-o").arg("tests/data/test-output.xmle");
cmd.assert()
.failure()
.code(1)
.stderr(predicate::str::contains("No such file or directory"));
Ok(())