forked from Galactic/galactic-bot
error logging
This commit is contained in:
parent
f48ba2ea61
commit
983c503088
@ -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}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user