Commit 5780d93
committed
fix(server): walk into Cause Fail reasons when detecting nested interrupt causes
findInterruptCause previously returned undefined immediately upon
encountering any Cause that was not interrupt-only, without inspecting
the Fail reasons' error values. This meant a Cause like
Cause.fail(new Error('cancelled', { cause: Cause.interrupt() }))
would not be recognized as an interrupt, causing failEnvironmentInternal
to log a synthetic 500 error and fail with EnvironmentHttpInternalError
instead of re-propagating the interruption.
Extract the loop body into a recursive walkForInterrupt helper that,
upon hitting a non-interrupt-only Cause, iterates Fail reasons and
continues walking each error's .cause chain. The depth budget and
seen-set are shared across recursive calls to prevent unbounded
traversal.1 parent 307df64 commit 5780d93
1 file changed
Lines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
86 | 94 | | |
87 | | - | |
| 95 | + | |
88 | 96 | | |
89 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
90 | 107 | | |
91 | 108 | | |
92 | 109 | | |
| |||
0 commit comments