Commit 8016d35
lib: http server, friendly error messages
Improved error message description for the http server binding errors.
Currently changed only in `setupListenHandle`, but needs to be
change all over.
Added new `uvExceptionWithHostPort` function (+export) in
`lib/internal/error.js` that extracts the error message defined by
libuv, using the error code, and returns an error object with the
full error description.
example:
old error message: `listen EADDRINUSE`
new error message: `listen EADDRINUSE: Address already in use`
Removed exportable function `_exceptionWithHostPort` from
`lib/util.js` - exported by accident
Replaced `exceptionWithHostPort` to the new function
`uvExceptionWithHostPort` for a more detailed error.
Fixes: #22936
PR-URL: #22995
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent cdb6da9 commit 8016d35Copy full SHA for 8016d35
File tree
Expand file treeCollapse file tree
3 files changed
+52
-6
lines changedOpen diff view settings
Filter options
- lib
- internal
- test/parallel
Expand file treeCollapse file tree
3 files changed
+52
-6
lines changedOpen diff view settings
Collapse file
+44-2Lines changed: 44 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
286 | 286 | |
287 | 287 | |
288 | 288 | |
| 289 | + |
| 290 | + |
| 291 | + |
| 292 | + |
| 293 | + |
| 294 | + |
| 295 | + |
| 296 | + |
| 297 | + |
| 298 | + |
| 299 | + |
| 300 | + |
| 301 | + |
| 302 | + |
| 303 | + |
| 304 | + |
| 305 | + |
| 306 | + |
| 307 | + |
| 308 | + |
| 309 | + |
| 310 | + |
| 311 | + |
| 312 | + |
| 313 | + |
| 314 | + |
| 315 | + |
| 316 | + |
| 317 | + |
| 318 | + |
| 319 | + |
| 320 | + |
| 321 | + |
| 322 | + |
| 323 | + |
| 324 | + |
| 325 | + |
| 326 | + |
| 327 | + |
| 328 | + |
289 | 329 | |
290 | 330 | |
291 | 331 | |
| ||
315 | 355 | |
316 | 356 | |
317 | 357 | |
318 | | - |
319 | | - |
| 358 | + |
| 359 | + |
| 360 | + |
320 | 361 | |
321 | 362 | |
322 | 363 | |
| ||
440 | 481 | |
441 | 482 | |
442 | 483 | |
| 484 | + |
443 | 485 | |
444 | 486 | |
445 | 487 | |
|
Collapse file
+7-3Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
83 | 83 | |
84 | 84 | |
85 | 85 | |
86 | | - |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
87 | 91 | |
88 | 92 | |
89 | 93 | |
| ||
1266 | 1270 | |
1267 | 1271 | |
1268 | 1272 | |
1269 | | - |
| 1273 | + |
1270 | 1274 | |
1271 | 1275 | |
1272 | 1276 | |
| ||
1283 | 1287 | |
1284 | 1288 | |
1285 | 1289 | |
1286 | | - |
| 1290 | + |
1287 | 1291 | |
1288 | 1292 | |
1289 | 1293 | |
|
Collapse file
test/parallel/test-net-server-listen-handle.js
Copy file name to clipboardExpand all lines: test/parallel/test-net-server-listen-handle.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
148 | 148 | |
149 | 149 | |
150 | 150 | |
151 | | - |
| 151 | + |
152 | 152 | |
153 | 153 | |
154 | 154 | |
0 commit comments