Skip to content

Commit 8bd9b7e

Browse files
committed
chore: improve error message on task arguments errors
1 parent b772172 commit 8bd9b7e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/actions/lifecycle.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,11 @@ export abstract class TasksMixin {
336336
const [priorityName, priority] =
337337
Object.entries(this._queues).find(([_, queue]) => queue.queueName === queueName) ?? [];
338338
args ??= priority?.args ?? this.args;
339-
args = typeof args === 'function' ? args(this as any) : args;
339+
try {
340+
args = typeof args === 'function' ? args(this as any) : args;
341+
} catch (error: any) {
342+
throw new Error(`Error while building arguments for ${namespace}#${methodName}: ${error.message}`);
343+
}
340344
this.runningState = { namespace, queueName, methodName };
341345
try {
342346
await method.apply(this, args);

0 commit comments

Comments
 (0)