mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 01:36:06 -04:00
handle and log failures to enact consequences
This commit is contained in:
parent
55fc94c4c2
commit
30eab1991b
@ -952,6 +952,7 @@ export class Mjolnir {
|
|||||||
|
|
||||||
private async handleConsequences(protection: Protection, roomId: string, eventId: string, sender: string, consequences: Consequence[]) {
|
private async handleConsequences(protection: Protection, roomId: string, eventId: string, sender: string, consequences: Consequence[]) {
|
||||||
for (const consequence of consequences) {
|
for (const consequence of consequences) {
|
||||||
|
try {
|
||||||
if (consequence.name === "alert") {
|
if (consequence.name === "alert") {
|
||||||
/* take no additional action, just print the below message to management room */
|
/* take no additional action, just print the below message to management room */
|
||||||
} else if (consequence.name === "ban") {
|
} else if (consequence.name === "ban") {
|
||||||
@ -976,6 +977,9 @@ export class Mjolnir {
|
|||||||
types: [consequence.name],
|
types: [consequence.name],
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} catch (e) {
|
||||||
|
await this.logMessage(LogLevel.ERROR, "handleConsequences", `Failed to enact ${consequence.name} consequence: ${e}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user