diff options
author | Joseph Frazer <joseph.frazer@ryansg.com> | 2020-03-06 11:29:04 -0500 |
---|---|---|
committer | Joseph Frazer <joseph.frazer@ryansg.com> | 2020-03-06 12:24:45 -0500 |
commit | 590245e191bcdd5fc0057c21785137083fc63759 (patch) | |
tree | 4e9f4ca9dce41419c74a43fb27dc1a451acbda39 | |
parent | bfea768f893dfd6fdddc9f620dac95757770b682 (diff) | |
download | tame-590245e191bcdd5fc0057c21785137083fc63759.tar.gz tame-590245e191bcdd5fc0057c21785137083fc63759.tar.bz2 tame-590245e191bcdd5fc0057c21785137083fc63759.zip |
[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.
-rw-r--r-- | tamer/src/ld/poc.rs | 2 | ||||
-rw-r--r-- | tamer/tests/tameld.rs | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/tamer/src/ld/poc.rs b/tamer/src/ld/poc.rs index e82c19f..905ce10 100644 --- a/tamer/src/ld/poc.rs +++ b/tamer/src/ld/poc.rs @@ -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!"); diff --git a/tamer/tests/tameld.rs b/tamer/tests/tameld.rs index 98d1974..30b2fea 100644 --- a/tamer/tests/tameld.rs +++ b/tamer/tests/tameld.rs @@ -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(()) |