Skip to content

Commit

Permalink
improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachiah committed Feb 13, 2024
1 parent 396e1c3 commit fe13c6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::projects_file::{
get_project_notes_file_path, get_project_position, read_projects, save_projects, Project,
};
use anyhow::{Context, Result};
use anyhow::{Context, Result, Error, anyhow};
use clap::{Parser, Subcommand};
use std::{os::unix::process::CommandExt, path::Path};

Expand Down Expand Up @@ -154,13 +154,10 @@ Tags: {tags}
.arg(project.folder.clone())
.current_dir(projects_dir)
.output()
.unwrap();
.context("Failed to clone git repo")?;

if !result.status.success() {
panic!(
"Failed to clone repo:\n{}",
std::str::from_utf8(&result.stderr).unwrap()
);
return Err(anyhow!("Failed to clone git repo"));
}
}

Expand Down

0 comments on commit fe13c6b

Please sign in to comment.