Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preventing the fail of the 'ETIMEDOUT' code in 500 'Internal server error' #480

Merged
merged 2 commits into from
Jan 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Preventing the fail of the 'ETIMEDOUT' code in 500 'Internal server e…
…rror'
  • Loading branch information
aremishevsky committed Oct 27, 2020
commit e4961b1d18e95a4e8793a40e393eb4e2f02f1f4c
1 change: 1 addition & 0 deletions src/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function defaultErrorHandler(err, req, res) {
case 'ECONNRESET':
case 'ENOTFOUND':
case 'ECONNREFUSED':
case 'ETIMEDOUT':
res.writeHead(504);
break;
default:
Expand Down
1 change: 1 addition & 0 deletions test/unit/handlers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ describe('default proxy error handler', () => {
['ECONNREFUSED', 504],
['ENOTFOUND', 504],
['ECONNREFUSED', 504],
['ETIMEDOUT', 504],
['any', 500],
];

Expand Down