@@ -128,7 +128,7 @@ use serde::de::DeserializeOwned;
128
128
use thiserror:: Error ;
129
129
use tokio:: { join, sync:: broadcast} ;
130
130
use tokio_stream:: StreamExt ;
131
- use tracing:: { debug, error, info, instrument, warn} ;
131
+ use tracing:: { debug, error, info, instrument, trace , warn} ;
132
132
133
133
use self :: futures:: { SendAttachment , SendMessageLikeEvent , SendRawMessageLikeEvent } ;
134
134
pub use self :: {
@@ -339,8 +339,6 @@ impl Room {
339
339
// The server can return with an error that is acceptable to ignore. Let's find
340
340
// which one.
341
341
if let Err ( error) = response {
342
- error ! ( ?error, "Failed to leave the room" ) ;
343
-
344
342
#[ allow( clippy:: collapsible_match) ]
345
343
let ignore_error = if let Some ( error) = error. client_api_error_kind ( ) {
346
344
match error {
@@ -353,6 +351,8 @@ impl Room {
353
351
false
354
352
} ;
355
353
354
+ error ! ( ?error, ignore_error, should_forget, "Failed to leave the room" ) ;
355
+
356
356
if !ignore_error {
357
357
return Err ( error. into ( ) ) ;
358
358
}
@@ -361,8 +361,10 @@ impl Room {
361
361
self . client . base_client ( ) . room_left ( self . room_id ( ) ) . await ?;
362
362
363
363
if should_forget {
364
+ trace ! ( "Trying to forget the room" ) ;
365
+
364
366
if let Err ( error) = self . forget ( ) . await {
365
- warn ! ( "Failed to forget room when leaving it: {error} " ) ;
367
+ error ! ( ?error , "Failed to forget the room " ) ;
366
368
}
367
369
}
368
370
0 commit comments