mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 22:21:10 +02:00
🔧 chore(clock-bot): improve room topic error logging
This commit is contained in:
parent
72b162524c
commit
102f0df518
1 changed files with 9 additions and 2 deletions
|
|
@ -296,11 +296,18 @@ export class MatrixService extends BaseMatrixService implements OnModuleDestroy
|
|||
private async setRoomTopic(roomId: string, topic: string): Promise<void> {
|
||||
try {
|
||||
const client = this.getClient();
|
||||
this.logger.debug(`Attempting to set room topic for ${roomId}: ${topic}`);
|
||||
await client.sendStateEvent(roomId, 'm.room.topic', '', { topic });
|
||||
this.logger.log(`Room topic updated: ${topic}`);
|
||||
} catch (error: unknown) {
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
this.logger.error(`Failed to set room topic for ${roomId}: ${errorMessage}`);
|
||||
// Log full error details including Matrix errcode
|
||||
const errorDetails =
|
||||
error && typeof error === 'object'
|
||||
? JSON.stringify(error, null, 2)
|
||||
: String(error);
|
||||
this.logger.error(
|
||||
`Failed to set room topic for ${roomId}. Topic: "${topic}". Error: ${errorDetails}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue