Do not panic on failure to read IMAP server greeting

This commit is contained in:
Alexander Krotov
2019-12-16 15:07:46 +03:00
committed by holger krekel
parent 15792d8426
commit f81f3fb060

View File

@@ -46,7 +46,7 @@ impl Client {
let _greeting = client
.read_response()
.await
.expect("failed to read greeting");
.ok_or_else(|| ImapError::Bad("failed to read greeting".to_string()))?;
Ok(Client::Secure(client))
}
@@ -61,7 +61,7 @@ impl Client {
let _greeting = client
.read_response()
.await
.expect("failed to read greeting");
.ok_or_else(|| ImapError::Bad("failed to read greeting".to_string()))?;
Ok(Client::Insecure(client))
}