(please) dont drop true error in presence timer creation failures

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-02-10 11:43:38 -05:00 committed by June
parent 8e6d52e7dd
commit d069379d77

View file

@ -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()?)?;