Commit ef85bd1
committed
worker: unify custom error creation
Mostly, this introduces a pattern that makes sure that if a custom
error is reported, `stopped_` will be set to `true` correctly in
every cast, which was previously missing for the
`NewContext().IsEmpty()` case (which led to a hard crash from the
`Worker` destructor).
This also leaves TODO comments for a few cases in which
`ERR_WORKER_OUT_OF_MEMORY` was not used in accordance with the
documentation for that error code (or according to its intention).
Fixing that is semver-major.
PR-URL: #33084
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>1 parent 11bc30d commit ef85bd1
2 files changed
+22
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
| 134 | + | |
137 | 135 | | |
138 | 136 | | |
139 | 137 | | |
| |||
148 | 146 | | |
149 | 147 | | |
150 | 148 | | |
151 | | - | |
152 | | - | |
153 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
154 | 152 | | |
155 | 153 | | |
156 | 154 | | |
| |||
233 | 231 | | |
234 | 232 | | |
235 | 233 | | |
236 | | - | |
237 | | - | |
238 | | - | |
| 234 | + | |
239 | 235 | | |
240 | 236 | | |
241 | 237 | | |
| |||
292 | 288 | | |
293 | 289 | | |
294 | 290 | | |
295 | | - | |
296 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
297 | 294 | | |
298 | 295 | | |
299 | 296 | | |
| |||
682 | 679 | | |
683 | 680 | | |
684 | 681 | | |
685 | | - | |
| 682 | + | |
686 | 683 | | |
687 | | - | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
688 | 692 | | |
689 | 693 | | |
690 | 694 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
0 commit comments