summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2022-10-30 11:27:54 +0200
committerDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2022-10-30 11:40:46 +0200
commit81bc10ebf91e4cf05b2436414bc2b04765c3550c (patch)
treedf1b22a873af0de1ba304fa90558a111080425b0
parentdbb83aaab7cfa2c16c948e425a467baa4cd249ff (diff)
mu-maildir: improve error handling / reporting
-rw-r--r--lib/mu-maildir.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/mu-maildir.cc b/lib/mu-maildir.cc
index 15c15bf..8b27aa7 100644
--- a/lib/mu-maildir.cc
+++ b/lib/mu-maildir.cc
@@ -296,7 +296,7 @@ msg_move_g_file(const std::string& src, const std::string& dst)
if (res)
return Ok();
else
- return Err(Error{Error::Code::File, &err,
+ return Err(Error{Error::Code::File, &err/*consumed*/,
"error moving %s -> %s",
src.c_str(), dst.c_str()});
}
@@ -313,15 +313,15 @@ msg_move(const std::string& src, const std::string& dst, bool force_gio)
return msg_move_verify(src, dst);
if (errno != EXDEV) /* some unrecoverable error occurred */
- return Err(Error{Error::Code::File, "error moving %s -> %s",
- src.c_str(), dst.c_str()});
+ return Err(Error{Error::Code::File, "error moving %s -> %s: %s",
+ src.c_str(), dst.c_str(), strerror(errno)});
}
/* the EXDEV / force-gio case -- source and target live on different
* filesystems */
- if (!msg_move_g_file(src, dst))
- return Err(Error{Error::Code::File, "error moving %s -> %s",
- src.c_str(), dst.c_str()});
+ auto res = msg_move_g_file(src, dst);
+ if (!res)
+ return res;
else
return msg_move_verify(src, dst);
}