diff --git a/source/Events/EventHandler.ts b/source/Events/EventHandler.ts index 48f2ee7..dd41dc5 100644 --- a/source/Events/EventHandler.ts +++ b/source/Events/EventHandler.ts @@ -1,6 +1,8 @@ import cron, {validate} from "node-cron"; import {Class} from "../types/Class"; import {randomUUID} from "node:crypto"; +import {Container} from "../Container/Container"; +import {Logger} from "log4js"; export type EventConfiguration = { name: string, @@ -49,7 +51,11 @@ export class EventHandler { } this.eventHandlers.get(eventName)?.forEach((handler) => { - handler(event); + try { + handler(event); + } catch (e: any) { + Container.get("logger").error(e); + } }) }