Skip to content

Commit

Permalink
Merge pull request #33 from deadlinks/feat/err_msg_missing_dir
Browse files Browse the repository at this point in the history
feat(error): improve error message for missing target doc directory
  • Loading branch information
hobofan authored Jan 9, 2019
2 parents c52ada0 + 7a4fbc3 commit 94cb69e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,15 @@ fn main() {
.arg_directory
.clone()
.map_or_else(determine_dir, |dir| PathBuf::from(dir));
let dir = dir.canonicalize().unwrap();
let dir = match dir.canonicalize() {
Ok(dir) => dir,
Err(_) => {
println!("Could not find directory {:?}.", dir);
println!("");
println!("Please run `cargo doc` before running `cargo deadlinks`.");
process::exit(1);
}
};
let ctx: CheckContext = args.into();
if !walk_dir(&dir, &ctx) {
process::exit(1);
Expand Down

0 comments on commit 94cb69e

Please sign in to comment.