diff options
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)> { |