Skip to content

Commit 0e53e4f

Browse files
aremishevskysarumont
authored andcommitted
Preventing the fail of the 'ETIMEDOUT' code in 500 'Internal server error' (chimurai#480)
Thanks for this PR!
1 parent a1fc2d8 commit 0e53e4f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/handlers.ts

+1
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

+1
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)