From d069379d77f81f5199509c62edc30dac3268d77e Mon Sep 17 00:00:00 2001 From: strawberry Date: Sat, 10 Feb 2024 11:43:38 -0500 Subject: [PATCH] (please) dont drop true error in presence timer creation failures Signed-off-by: strawberry --- src/database/key_value/rooms/edus/presence.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/database/key_value/rooms/edus/presence.rs b/src/database/key_value/rooms/edus/presence.rs index 544f1537..85f9b848 100644 --- a/src/database/key_value/rooms/edus/presence.rs +++ b/src/database/key_value/rooms/edus/presence.rs @@ -3,6 +3,7 @@ use std::time::Duration; use ruma::{ events::presence::PresenceEvent, presence::PresenceState, OwnedUserId, RoomId, UInt, UserId, }; +use tracing::error; use crate::{ database::KeyValueDatabase, @@ -83,7 +84,10 @@ impl service::rooms::edus::presence::Data for KeyValueDatabase { self.presence_timer_sender .send((user_id.to_owned(), Duration::from_secs(timeout))) - .map_err(|_| Error::bad_database("Failed to add presence timer")) + .map_err(|e| { + error!("Failed to add presence timer: {}", e); + Error::bad_database("Failed to add presence timer") + }) } fn set_presence( @@ -118,7 +122,10 @@ impl service::rooms::edus::presence::Data for KeyValueDatabase { self.presence_timer_sender .send((user_id.to_owned(), Duration::from_secs(timeout))) - .map_err(|_| Error::bad_database("Failed to add presence timer"))?; + .map_err(|e| { + error!("Failed to add presence timer: {}", e); + Error::bad_database("Failed to add presence timer") + })?; self.roomuserid_presence .insert(&key, &presence.to_json_bytes()?)?;