From 983c503088b2c96ac7f26cb7eb8ac1c00bb47bbf Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 18 Jul 2022 20:11:31 +0300 Subject: [PATCH] error logging --- src/structure/client/EventHooker.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/structure/client/EventHooker.js b/src/structure/client/EventHooker.js index 5c709de..0995438 100644 --- a/src/structure/client/EventHooker.js +++ b/src/structure/client/EventHooker.js @@ -57,7 +57,11 @@ class EventHooker { // 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 for (const handler of this.events.get(eventName)) { - await handler(...args); + try { // this try-catch should only be temporary until any issues have been ironed out + await handler(...args); + } catch (err) { + this.logger.error(`Event handler (${handler.name}) for ${eventName} errored:\n${err.stack}`); + } } }); }