From a199fbc7f71dc0565a6c811735981ec8fc73d829 Mon Sep 17 00:00:00 2001 From: Sebastian Kuzminsky Date: Wed, 9 Jul 2025 22:09:50 -0600 Subject: [PATCH] handle aborts in `ent edit ISSUE` The user saving an empty description file is a normal user-initiated abort, not an error. --- src/bin/ent/main.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/bin/ent/main.rs b/src/bin/ent/main.rs index 6fb30c9..fa18b2a 100644 --- a/src/bin/ent/main.rs +++ b/src/bin/ent/main.rs @@ -150,9 +150,16 @@ fn handle_command(args: &Args, issues_dir: &std::path::Path) -> anyhow::Result<( let mut issues = entomologist::issues::Issues::new_from_dir(std::path::Path::new(issues_dir))?; match issues.get_mut_issue(issue_id) { - Some(issue) => { - issue.edit_description()?; - } + Some(issue) => match issue.edit_description() { + Err(entomologist::issue::IssueError::EmptyDescription) => { + println!("aborted issue edit"); + return Ok(()); + } + Err(e) => { + return Err(e.into()); + } + Ok(()) => (), + }, None => { return Err(anyhow::anyhow!("issue {} not found", issue_id)); }