Skip to content

Commit

Permalink
refactor(link): add Ok and make IoError more understandable
Browse files Browse the repository at this point in the history
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
  • Loading branch information
cafkafk committed Oct 17, 2023
1 parent f17e2a5 commit 4a0f855
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,10 @@ impl Config {
let mut sp =
Spinner::new(Spinners::Dots10, format!("{}: {}", link.name, op));
match f(link) {
Ok(_) => sp.stop_and_persist(
success_str(),
format!("{}: {}", link.name, op),
),
Err(e @ LinkError::AlreadyLinked(_, _)) => {
sp.stop_and_persist(success_str(), format!("{e}"))
}
Expand All @@ -613,9 +617,10 @@ impl Config {
Err(e @ LinkError::FailedCreatingLink(_, _)) => {
sp.stop_and_persist(failure_str(), format!("{e}"))
}
Err(e @ LinkError::IoError(_)) => {
sp.stop_and_persist(failure_str(), format!("{e}"))
}
Err(e @ LinkError::IoError(_)) => sp.stop_and_persist(
failure_str(),
format!("{}: {op}, {e}", link.name),
),
Err(e) => sp.stop_and_persist(failure_str(), format!("{e}")),
_ => sp.stop_and_persist(
failure_str(),
Expand Down

0 comments on commit 4a0f855

Please sign in to comment.