From 83a6aa0574190137b38331bd53795324139237cf Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Thu, 27 Mar 2025 14:57:48 +0000 Subject: feat: remove `UpdateMessage::Error` variant --- filamento/src/logic/process_stanza.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'filamento/src/logic/process_stanza.rs') diff --git a/filamento/src/logic/process_stanza.rs b/filamento/src/logic/process_stanza.rs index 3dfe9fb..94257aa 100644 --- a/filamento/src/logic/process_stanza.rs +++ b/filamento/src/logic/process_stanza.rs @@ -271,7 +271,9 @@ pub async fn recv_iq( if let Err(e) = logic.db().delete_contact(item.jid.clone()).await { - error!("{}", RosterError::Cache(e.into())); + logic + .handle_error(RosterError::Cache(e.into()).into()) + .await; } Ok(Some(UpdateMessage::RosterDelete(item.jid))) } @@ -279,7 +281,9 @@ pub async fn recv_iq( let contact: Contact = item.into(); if let Err(e) = logic.db().upsert_contact(contact.clone()).await { - error!("{}", RosterError::Cache(e.into())); + logic + .handle_error(RosterError::Cache(e.into()).into()) + .await; } let iq = Iq { from: Some(connection.jid().clone()), @@ -293,7 +297,9 @@ pub async fn recv_iq( if let Err(e) = connection.write_handle().write(Stanza::Iq(iq)).await { - error!("could not reply to roster set: {}", e); + logic + .handle_error(RosterError::PushReply(e.into()).into()) + .await; } Ok(Some(UpdateMessage::RosterUpdate(contact))) } -- cgit