Skip to content

Commit

Permalink
fix: improve error message for on handler
Browse files Browse the repository at this point in the history
  • Loading branch information
simllll committed Aug 2, 2022
1 parent 3d24698 commit 92d42ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class Agenda extends EventEmitter {
on(event: 'error', listener: (error: Error) => void): this;
on(event: string, listener: (...args) => void): this {
if (this.forkedWorker && event !== 'ready') {
const warning = new Error('calling on() during a forkedWorker has no effect!');
const warning = new Error(`calling on(${event}) during a forkedWorker has no effect!`);
console.warn(warning.message, warning.stack);
return this;
}
Expand Down

0 comments on commit 92d42ca

Please sign in to comment.