diff --git a/src/index.ts b/src/index.ts index c125520..1b1e876 100644 --- a/src/index.ts +++ b/src/index.ts @@ -56,7 +56,7 @@ export class Agenda extends EventEmitter { on(event: 'ready', listener: () => void): this; on(event: 'error', listener: (error: Error) => void): this; on(event: string, listener: (...args) => void): this { - if (this.forkedWorker && event !== 'ready') { + if (this.forkedWorker && event !== 'ready' && event !== 'error') { const warning = new Error(`calling on(${event}) during a forkedWorker has no effect!`); console.warn(warning.message, warning.stack); return this;