Commit 3f50919
committed
fix: move activity input JSON.parse inside try-catch for proper error handling
The JSON.parse call for deserializing activity input was positioned outside
the try-catch block in ActivityExecutor.execute(). When encodedInput contained
malformed JSON, the SyntaxError bypassed the activityFailed log (EventId 605)
and propagated with no activity context (name, orchestrationId).
Move JSON.parse inside the existing try-catch so all activity execution
failures — including input deserialization errors — are logged consistently
and re-thrown with proper context.
Add unit tests for malformed JSON input, undefined input, and empty string
input edge cases.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 29455dd commit 3f50919
2 files changed
Lines changed: 57 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
56 | 97 | | |
57 | 98 | | |
58 | 99 | | |
59 | | - | |
| 100 | + | |
60 | 101 | | |
61 | 102 | | |
62 | | - | |
| 103 | + | |
63 | 104 | | |
64 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
0 commit comments