Fix test failure

This commit is contained in:
Jonathan Turner 2019-08-11 08:33:22 +12:00
parent 8f78995014
commit d07a3928b2

View File

@ -226,7 +226,7 @@ pub fn fetch(
} }
} else { } else {
cwd.push(Path::new(location)); cwd.push(Path::new(location));
let cwd = dunce::canonicalize(cwd).unwrap(); if let Ok(cwd) = dunce::canonicalize(cwd) {
match std::fs::read(&cwd) { match std::fs::read(&cwd) {
Ok(bytes) => match std::str::from_utf8(&bytes) { Ok(bytes) => match std::str::from_utf8(&bytes) {
Ok(s) => Ok(( Ok(s) => Ok((
@ -257,6 +257,13 @@ pub fn fetch(
)); ));
} }
} }
} else {
return Err(ShellError::labeled_error(
"File could not be opened",
"file not found",
span,
));
}
} }
} }