Commit 92969e2
committed
fix(webapp): drop dead
Both nits surfaced by a local code review of the previous commit:
- `findOrCreateBackgroundWorker` returns `Promise<BackgroundWorker>`
(non-null). After `if (findOrCreateError) throw`, TypeScript narrows
`backgroundWorker` to `BackgroundWorker` already, so the guard was dead
code. Worse, returning silently there would have been a 200 with no body
— strictly worse than the 5xx the rest of the file produces on internal
errors.
- Annotate that `#failBackgroundWorkerDeployment` throws its own argument,
so the outer `throw findOrCreateError` is only reachable on the non-SVE
branch. Same control flow, less confusing for future readers.!backgroundWorker guard, comment unreachable throw1 parent d6e4a0f commit 92969e2
1 file changed
Lines changed: 2 additions & 4 deletions
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | 119 | | |
122 | 120 | | |
123 | 121 | | |
| |||
0 commit comments