Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0a831f7

Browse files
authored
fix(Workflow): Avoid bubbling up "Unknown encoding" error to user (temporalio#133)
* fix(worker): Fail activity execution if arguments failed to parse * refactor(worker): Use unknown instead of any based on code review comments
1 parent bfbc5a9 commit 0a831f7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

packages/worker/src/worker.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,20 @@ export class Worker<T extends WorkerSpec = DefaultWorkerSpec> {
638638
};
639639
break;
640640
}
641-
const args = arrayFromPayloads(this.options.dataConverter, task.start?.input);
641+
let args: unknown[];
642+
try {
643+
args = arrayFromPayloads(this.options.dataConverter, task.start?.input);
644+
} catch (err) {
645+
output = {
646+
type: 'result',
647+
result: {
648+
failed: {
649+
failure: { message: `Failed to parse activity args for activity ${fnName}: ${err.message}` },
650+
},
651+
},
652+
};
653+
break;
654+
}
642655
const headers = new Map(Object.entries(task.start?.headerFields ?? {}));
643656
const input = {
644657
args,

0 commit comments

Comments
 (0)