mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +00:00
fix: add modes export, fix event firing with modes and cloudflare
This commit is contained in:
@@ -205,7 +205,17 @@ export class EventManager<
|
||||
if (listener.mode === "sync") {
|
||||
syncs.push(listener);
|
||||
} else {
|
||||
asyncs.push(async () => await listener.handler(event, listener.event.slug));
|
||||
asyncs.push(async () => {
|
||||
try {
|
||||
await listener.handler(event, listener.event.slug);
|
||||
} catch (e) {
|
||||
if (this.options?.onError) {
|
||||
this.options.onError(event, e);
|
||||
} else {
|
||||
$console.error("Error executing async listener", listener, e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// Remove if `once` is true, otherwise keep
|
||||
return !listener.once;
|
||||
|
||||
Reference in New Issue
Block a user