Prevent double saving of translated chats. Exception-safe event emitter

This commit is contained in:
SillyLossy
2023-05-28 19:09:10 +03:00
parent 88c92c76ae
commit 29f21f6b6a
3 changed files with 11 additions and 5 deletions

View File

@ -56,7 +56,13 @@ EventEmitter.prototype.emit = async function (event) {
length = listeners.length;
for (i = 0; i < length; i++) {
await listeners[i].apply(this, args);
try {
await listeners[i].apply(this, args);
}
catch (err) {
console.error(err);
console.trace('Error in event listener');
}
}
}
};