Commit 18ecaeb
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.
Backport-PR-URL: #35241
PR-URL: #33084
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 1066341 commit 18ecaebCopy full SHA for 18ecaeb
File tree
Expand file treeCollapse file tree
2 files changed
+22
-15
lines changedOpen diff view settings
Filter options
- src
Expand file treeCollapse file tree
2 files changed
+22
-15
lines changedOpen diff view settings
Collapse file
+17-13Lines changed: 17 additions & 13 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
136 | 136 | |
137 | 137 | |
138 | 138 | |
139 | | - |
140 | | - |
141 | | - |
| 139 | + |
142 | 140 | |
143 | 141 | |
144 | 142 | |
| ||
152 | 150 | |
153 | 151 | |
154 | 152 | |
155 | | - |
156 | | - |
157 | | - |
| 153 | + |
| 154 | + |
| 155 | + |
158 | 156 | |
159 | 157 | |
160 | 158 | |
| ||
237 | 235 | |
238 | 236 | |
239 | 237 | |
240 | | - |
241 | | - |
242 | | - |
| 238 | + |
243 | 239 | |
244 | 240 | |
245 | 241 | |
| ||
301 | 297 | |
302 | 298 | |
303 | 299 | |
304 | | - |
305 | | - |
| 300 | + |
| 301 | + |
| 302 | + |
306 | 303 | |
307 | 304 | |
308 | 305 | |
| ||
685 | 682 | |
686 | 683 | |
687 | 684 | |
688 | | - |
| 685 | + |
689 | 686 | |
690 | | - |
| 687 | + |
| 688 | + |
| 689 | + |
| 690 | + |
| 691 | + |
| 692 | + |
| 693 | + |
| 694 | + |
691 | 695 | |
692 | 696 | |
693 | 697 | |
|
Collapse file
+5-2Lines changed: 5 additions & 2 deletions
| 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