Skip to content

Commit 7ae82e8

Browse files
authored
Preventing the fail of the 'ETIMEDOUT' code in 500 'Internal server error' (chimurai#480)
Thanks for this PR!
1 parent f77121f commit 7ae82e8

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/handlers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ function defaultErrorHandler(err, req, res) {
5454
case 'ECONNRESET':
5555
case 'ENOTFOUND':
5656
case 'ECONNREFUSED':
57+
case 'ETIMEDOUT':
5758
res.writeHead(504);
5859
break;
5960
default:

test/unit/handlers.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ describe('default proxy error handler', () => {
104104
['ECONNREFUSED', 504],
105105
['ENOTFOUND', 504],
106106
['ECONNREFUSED', 504],
107+
['ETIMEDOUT', 504],
107108
['any', 500],
108109
];
109110

0 commit comments

Comments
 (0)