mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Prevent double saving of translated chats. Exception-safe event emitter
This commit is contained in:
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user