Commit 949d360
committed
loader: TSError that survives thread comms channel
When an error is thrown in the loader thread, it must be passed through
the comms channel to be printed in the main thread.
Node has some heuristics to try to reconstitute errors properly, but
they don't function very well if the error has a custom inspect method,
or properties that are not compatible with JSON.stringify, so the
TSErrors raised by the source transforms don't get printed in any sort
of useful way.
This catches those errors, and creates a new error that can go through
the comms channel intact.
Another possible approach would be to update the shape of the errors
raised by source transforms, but that would be a much more extensive
change with further reaching consequences.1 parent a925654 commit 949d360
2 files changed
+28
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
255 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
256 | 271 | | |
257 | 272 | | |
258 | 273 | | |
| |||
360 | 375 | | |
361 | 376 | | |
362 | 377 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
370 | 386 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
0 commit comments