mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 10:56:29 +03:00
Return Option from Contact::add_or_lookup()
This allows to distinguish exceptions, such as database errors, from invalid user input. For example, if the From: field of the message does not look like an email address, the mail should be ignored. But if there is a database failure while writing a new contact for the address, this error should be bubbled up.
This commit is contained in:
@@ -1006,7 +1006,8 @@ mod tests {
|
||||
"bob@example.net",
|
||||
Origin::ManuallyCreated,
|
||||
)
|
||||
.await?;
|
||||
.await?
|
||||
.unwrap();
|
||||
let contact_bob = Contact::load_from_db(&alice.ctx, contact_bob_id).await?;
|
||||
assert_eq!(
|
||||
contact_bob.is_verified(&alice.ctx).await?,
|
||||
|
||||
Reference in New Issue
Block a user