error logging

This commit is contained in:
Erik 2022-07-18 20:11:31 +03:00
parent f48ba2ea61
commit 983c503088
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -57,7 +57,11 @@ class EventHooker {
// the forEach implementation does not await the results of the function before moving onto the next iteration // the forEach implementation does not await the results of the function before moving onto the next iteration
// which is a problem if we don't want functionality to be overlapping, i.e. different filters trying to delete the same message // which is a problem if we don't want functionality to be overlapping, i.e. different filters trying to delete the same message
for (const handler of this.events.get(eventName)) { for (const handler of this.events.get(eventName)) {
try { // this try-catch should only be temporary until any issues have been ironed out
await handler(...args); await handler(...args);
} catch (err) {
this.logger.error(`Event handler (${handler.name}) for ${eventName} errored:\n${err.stack}`);
}
} }
}); });
} }