Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Frazer <joseph.frazer@ryansg.com>2020-03-06 11:29:04 -0500
committerJoseph Frazer <joseph.frazer@ryansg.com>2020-03-06 12:24:45 -0500
commit590245e191bcdd5fc0057c21785137083fc63759 (patch)
tree4e9f4ca9dce41419c74a43fb27dc1a451acbda39
parentbfea768f893dfd6fdddc9f620dac95757770b682 (diff)
downloadtame-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.rs2
-rw-r--r--tamer/tests/tameld.rs1
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(())