(please) dont drop true error in presence timer creation failures
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
8e6d52e7dd
commit
d069379d77
1 changed files with 9 additions and 2 deletions
|
@ -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()?)?;
|
||||
|
|
Loading…
Add table
Reference in a new issue