diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-09-27 13:18:59 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-09-27 13:40:02 +0300 |
commit | 68c40a292091c9d0378ffcf31e53afd9535ac6a6 (patch) | |
tree | 855b8baa8292bae451f4a58691c02f49b9c7ac4a /ui/src/components/mail/listing/conversations.rs | |
parent | d44a68ec6950c533cf67ee2a34f9888a4ae569cc (diff) |
melib: return Result with error when an IO operation fails
Don't unwrap anything because this might be temporary, for example a
short IMAP disconnection.
Diffstat (limited to 'ui/src/components/mail/listing/conversations.rs')
-rw-r--r-- | ui/src/components/mail/listing/conversations.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/src/components/mail/listing/conversations.rs b/ui/src/components/mail/listing/conversations.rs index 716f0882..f40c3583 100644 --- a/ui/src/components/mail/listing/conversations.rs +++ b/ui/src/components/mail/listing/conversations.rs @@ -417,7 +417,13 @@ impl ListingTrait for ConversationsListing { continue; } let op = account.operation(env_hash); - let body = envelope.body(op); + let body = match envelope.body(op) { + Ok(b) => b, + Err(e) => { + error = Some(e); + break; + } + }; let decoded = decode_rec(&body, None); let body_text = String::from_utf8_lossy(&decoded); if body_text.contains(&filter_term) { |