Commit 81e4faa
fix(@angular/build): preserve error stack traces during prerendering
Reorder the nullish coalescing chain from `err.message ?? err.stack` to
`err.stack ?? err.message` so that the full stack trace is preserved when
available. Since `err.message` is almost always defined on Error objects,
the previous order meant `err.stack` was never reached.
Also add `assertIsError(err)` and consistent `err.code` inclusion across
all three error-handling locations for improved type safety and debugging.
Fixes #325031 parent e558117 commit 81e4faa
File tree
1 file changed
+8
-3
lines changed- packages/angular/build/src/utils/server-rendering
1 file changed
+8
-3
lines changedLines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
119 | 121 | | |
120 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
121 | 125 | | |
122 | 126 | | |
123 | 127 | | |
| |||
265 | 269 | | |
266 | 270 | | |
267 | 271 | | |
| 272 | + | |
268 | 273 | | |
269 | | - | |
| 274 | + | |
270 | 275 | | |
271 | 276 | | |
272 | 277 | | |
| |||
371 | 376 | | |
372 | 377 | | |
373 | 378 | | |
374 | | - | |
| 379 | + | |
375 | 380 | | |
376 | 381 | | |
377 | 382 | | |
| |||
0 commit comments