aboutsummaryrefslogtreecommitdiff
path: root/src/imap/command/selected.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-29 20:00:38 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-29 20:00:38 +0200
commitb71d9678892814a62d422af11eb91e61943836a2 (patch)
treebbfcb8964fa87361595dfb89d9c174bf24458b0a /src/imap/command/selected.rs
parentde71f4b4edcd66e68a79ce15800a7eab0f6ad72c (diff)
downloadaerogramme-b71d9678892814a62d422af11eb91e61943836a2.tar.gz
aerogramme-b71d9678892814a62d422af11eb91e61943836a2.zip
Fetch ENVELOPE works \o/
Diffstat (limited to 'src/imap/command/selected.rs')
-rw-r--r--src/imap/command/selected.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/imap/command/selected.rs b/src/imap/command/selected.rs
index e10eab6..b3a2ffd 100644
--- a/src/imap/command/selected.rs
+++ b/src/imap/command/selected.rs
@@ -46,12 +46,13 @@ impl<'a> SelectedContext<'a> {
attributes: &MacroOrFetchAttributes,
uid: &bool,
) -> Result<(Response, flow::Transition)> {
- let resp = self.mailbox.fetch(sequence_set, attributes, uid).await?;
-
- Ok((
- Response::ok("FETCH completed")?.with_body(resp),
- flow::Transition::None,
- ))
+ match self.mailbox.fetch(sequence_set, attributes, uid).await {
+ Ok(resp) => Ok((
+ Response::ok("FETCH completed")?.with_body(resp),
+ flow::Transition::None,
+ )),
+ Err(e) => Ok((Response::no(&e.to_string())?, flow::Transition::None)),
+ }
}
pub async fn noop(self) -> Result<(Response, flow::Transition)> {