diff options
author | Alex Auvolat <alex@adnab.me> | 2022-06-29 20:00:38 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-06-29 20:00:38 +0200 |
commit | b71d9678892814a62d422af11eb91e61943836a2 (patch) | |
tree | bbfcb8964fa87361595dfb89d9c174bf24458b0a /src/imap/command/selected.rs | |
parent | de71f4b4edcd66e68a79ce15800a7eab0f6ad72c (diff) | |
download | aerogramme-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.rs | 13 |
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)> { |