Commit da3137d
src: don't print garbage errors
If JS throws an object whose toString() method throws, then Node
attempts to print an empty message, but actually prints garbage.
This commit checks for this case, and prints a message instead.
Fixes: #4079
PR-URL: #4112
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>1 parent 1d50819 commit da3137dCopy full SHA for da3137d
File tree
Expand file treeCollapse file tree
3 files changed
+15
-5
lines changedOpen diff view settings
Filter options
- src
- test
- fixtures
- parallel
Expand file treeCollapse file tree
3 files changed
+15
-5
lines changedOpen diff view settings
Collapse file
+4-2Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1511 | 1511 | |
1512 | 1512 | |
1513 | 1513 | |
1514 | | - |
1515 | | - |
| 1514 | + |
| 1515 | + |
| 1516 | + |
| 1517 | + |
1516 | 1518 | |
1517 | 1519 | |
1518 | 1520 | |
|
Collapse file
test/fixtures/throws_error7.js
Copy file name to clipboard+5Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
Collapse file
test/parallel/test-error-reporting.js
Copy file name to clipboardExpand all lines: test/parallel/test-error-reporting.js+6-3Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
24 | 24 | |
25 | 25 | |
26 | 26 | |
27 | | - |
28 | | - |
29 | 27 | |
30 | 28 | |
31 | 29 | |
| ||
64 | 62 | |
65 | 63 | |
66 | 64 | |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
67 | 70 | |
68 | | - |
| 71 | + |
69 | 72 | |
0 commit comments