Commit 78972d4
committed
worker: support more cases when (de)serializing errors
- error.cause is potentially an error, so is now handled recursively
- best effort to serialize thrown symbols
- handle thrown object with custom inspect
PR-URL: #47925
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>1 parent 2b65625 commit 78972d4Copy full SHA for 78972d4
File tree
Expand file treeCollapse file tree
2 files changed
+111
-11
lines changedOpen diff view settings
Filter options
- lib/internal
- test/parallel
Expand file treeCollapse file tree
2 files changed
+111
-11
lines changedOpen diff view settings
Collapse file
lib/internal/error_serdes.js
Copy file name to clipboardExpand all lines: lib/internal/error_serdes.js+52-11Lines changed: 52 additions & 11 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
13 | 13 | |
14 | 14 | |
15 | 15 | |
| 16 | + |
16 | 17 | |
17 | 18 | |
18 | 19 | |
19 | 20 | |
| 21 | + |
| 22 | + |
20 | 23 | |
21 | 24 | |
| 25 | + |
22 | 26 | |
| 27 | + |
| 28 | + |
| 29 | + |
23 | 30 | |
24 | 31 | |
| 32 | + |
25 | 33 | |
26 | 34 | |
27 | 35 | |
28 | 36 | |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
29 | 41 | |
30 | 42 | |
31 | 43 | |
| ||
42 | 54 | |
43 | 55 | |
44 | 56 | |
| 57 | + |
45 | 58 | |
46 | 59 | |
47 | 60 | |
48 | 61 | |
49 | 62 | |
50 | 63 | |
| 64 | + |
| 65 | + |
51 | 66 | |
52 | 67 | |
53 | 68 | |
54 | 69 | |
55 | | - |
56 | | - |
57 | | - |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
58 | 75 | |
59 | 76 | |
60 | 77 | |
| ||
95 | 112 | |
96 | 113 | |
97 | 114 | |
| 115 | + |
| 116 | + |
| 117 | + |
98 | 118 | |
99 | 119 | |
100 | 120 | |
| ||
113 | 133 | |
114 | 134 | |
115 | 135 | |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | + |
| 143 | + |
116 | 144 | |
117 | 145 | |
118 | 146 | |
119 | 147 | |
120 | 148 | |
121 | 149 | |
122 | | - |
123 | | - |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | + |
| 156 | + |
124 | 157 | |
125 | 158 | |
126 | 159 | |
| ||
132 | 165 | |
133 | 166 | |
134 | 167 | |
135 | | - |
| 168 | + |
136 | 169 | |
137 | 170 | |
| 171 | + |
| 172 | + |
| 173 | + |
138 | 174 | |
139 | 175 | |
140 | 176 | |
141 | 177 | |
142 | | - |
143 | | - |
144 | | - |
145 | | - |
146 | | - |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | + |
| 182 | + |
147 | 183 | |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | + |
148 | 189 | |
149 | 190 | |
150 | 191 | |
|
Collapse file
test/parallel/test-error-serdes.js
Copy file name to clipboardExpand all lines: test/parallel/test-error-serdes.js+59Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2 | 2 | |
3 | 3 | |
4 | 4 | |
| 5 | + |
5 | 6 | |
6 | 7 | |
7 | 8 | |
| ||
15 | 16 | |
16 | 17 | |
17 | 18 | |
| 19 | + |
| 20 | + |
| 21 | + |
18 | 22 | |
19 | 23 | |
20 | 24 | |
| ||
43 | 47 | |
44 | 48 | |
45 | 49 | |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
46 | 96 | |
47 | 97 | |
48 | 98 | |
| ||
66 | 116 | |
67 | 117 | |
68 | 118 | |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | + |
0 commit comments