@@ -228,7 +228,7 @@ export class FederationMatrix extends ServiceClass implements IFederationMatrixS
228228
229229 return matrixRoomResult ;
230230 } catch ( error ) {
231- this . logger . error ( 'Failed to create room:' , error ) ;
231+ this . logger . error ( error , 'Failed to create room' ) ;
232232 throw error ;
233233 }
234234 }
@@ -302,7 +302,7 @@ export class FederationMatrix extends ServiceClass implements IFederationMatrixS
302302 userIdSchema . parse ( actualMatrixUserId ) ,
303303 ) ;
304304 } catch ( error ) {
305- this . logger . error ( 'Error creating or updating bridged user for DM:' , error ) ;
305+ this . logger . error ( error , 'Error creating or updating bridged user for DM' ) ;
306306 }
307307 }
308308 }
@@ -311,9 +311,9 @@ export class FederationMatrix extends ServiceClass implements IFederationMatrixS
311311 mrid : matrixRoomResult . room_id ,
312312 origin : this . serverName ,
313313 } ) ;
314- this . logger . debug ( 'Direct message room creation completed successfully' , room . _id ) ;
314+ this . logger . debug ( room . _id , 'Direct message room creation completed successfully' ) ;
315315 } catch ( error ) {
316- this . logger . error ( 'Failed to create direct message room:' , error ) ;
316+ this . logger . error ( error , 'Failed to create direct message room' ) ;
317317 throw error ;
318318 }
319319 }
@@ -367,9 +367,10 @@ export class FederationMatrix extends ServiceClass implements IFederationMatrixS
367367
368368 return lastEventId ;
369369 } catch ( error ) {
370- this . logger . error ( 'Failed to handle file message' , {
370+ this . logger . error ( {
371+ msg : 'Failed to handle file message' ,
371372 messageId : message . _id ,
372- error,
373+ err : error ,
373374 } ) ;
374375 throw error ;
375376 }
@@ -464,7 +465,7 @@ export class FederationMatrix extends ServiceClass implements IFederationMatrixS
464465
465466 this . logger . debug ( 'Message sent to Matrix successfully:' , result . eventId ) ;
466467 } catch ( error ) {
467- this . logger . error ( 'Failed to send message to Matrix:' , error ) ;
468+ this . logger . error ( error , 'Failed to send message to Matrix' ) ;
468469 throw error ;
469470 }
470471 }
@@ -526,7 +527,7 @@ export class FederationMatrix extends ServiceClass implements IFederationMatrixS
526527
527528 this . logger . debug ( 'Message Redaction sent to Matrix successfully:' , eventId ) ;
528529 } catch ( error ) {
529- this . logger . error ( 'Failed to send redaction to Matrix:' , error ) ;
530+ this . logger . error ( error , 'Failed to send redaction to Matrix' ) ;
530531 throw error ;
531532 }
532533 }
@@ -560,7 +561,7 @@ export class FederationMatrix extends ServiceClass implements IFederationMatrixS
560561 } ) ,
561562 ) ;
562563 } catch ( error ) {
563- this . logger . error ( 'Failed to invite a user to Matrix:' , error ) ;
564+ this . logger . error ( error , 'Failed to invite a user to Matrix' ) ;
564565 throw error ;
565566 }
566567 }
@@ -597,7 +598,7 @@ export class FederationMatrix extends ServiceClass implements IFederationMatrixS
597598
598599 this . logger . debug ( 'Reaction sent to Matrix successfully:' , eventId ) ;
599600 } catch ( error ) {
600- this . logger . error ( 'Failed to send reaction to Matrix:' , error ) ;
601+ this . logger . error ( error , 'Failed to send reaction to Matrix' ) ;
601602 throw error ;
602603 }
603604 }
@@ -651,7 +652,7 @@ export class FederationMatrix extends ServiceClass implements IFederationMatrixS
651652 break ;
652653 }
653654 } catch ( error ) {
654- this . logger . error ( 'Failed to remove reaction from Matrix:' , error ) ;
655+ this . logger . error ( error , 'Failed to remove reaction from Matrix' ) ;
655656 throw error ;
656657 }
657658 }
@@ -679,7 +680,7 @@ export class FederationMatrix extends ServiceClass implements IFederationMatrixS
679680
680681 this . logger . info ( `User ${ user . username } left Matrix room ${ room . federation . mrid } successfully` ) ;
681682 } catch ( error ) {
682- this . logger . error ( 'Failed to leave room in Matrix:' , error ) ;
683+ this . logger . error ( error , 'Failed to leave room in Matrix' ) ;
683684 throw error ;
684685 }
685686 }
@@ -703,7 +704,7 @@ export class FederationMatrix extends ServiceClass implements IFederationMatrixS
703704
704705 this . logger . info ( `User ${ removedUser . username } was kicked from Matrix room ${ room . federation . mrid } by ${ userWhoRemoved . username } ` ) ;
705706 } catch ( error ) {
706- this . logger . error ( 'Failed to kick user from Matrix room:' , error ) ;
707+ this . logger . error ( error , 'Failed to kick user from Matrix room' ) ;
707708 throw error ;
708709 }
709710 }
@@ -738,7 +739,7 @@ export class FederationMatrix extends ServiceClass implements IFederationMatrixS
738739
739740 this . logger . debug ( 'Message updated in Matrix successfully:' , eventId ) ;
740741 } catch ( error ) {
741- this . logger . error ( 'Failed to update message in Matrix:' , error ) ;
742+ this . logger . error ( error , 'Failed to update message in Matrix' ) ;
742743 throw error ;
743744 }
744745 }
0 commit comments