summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2024-12-09 13:00:49 +0100
committerJannis M. Hoffmann <jannis@fehcom.de>2024-12-09 13:00:49 +0100
commitb26eadcd2612c5d2163efa96678d00d0176bd919 (patch)
tree1e39a26e289912d43fb970b46b4ab7f952dd88c8 /src
parent671dd9e7a5ea3e30a89fc08389ab115b41a788e9 (diff)
improve error messages for Remove
Diffstat (limited to 'src')
-rw-r--r--src/cmd/remove.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cmd/remove.rs b/src/cmd/remove.rs
index 991c835..2779add 100644
--- a/src/cmd/remove.rs
+++ b/src/cmd/remove.rs
@@ -10,9 +10,14 @@ pub fn remove(
if let Some(p) = ms.maildir_path.read().unwrap().clone() {
let md = open_submaildir(p, &folder);
- md.delete(&mid).map_err(varlink::map_context!())?;
-
- call.reply()
+ let res = md.delete(&mid);
+ match res {
+ Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
+ call.reply_invalid_mid(folder, mid)
+ }
+ Err(e) => Err(varlink::context!(e, varlink::ErrorKind::from(&e))),
+ Ok(()) => call.reply(),
+ }
} else {
call.reply_not_initialized()
}