Skip to content

Commit

Permalink
added more error codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
netptop committed Mar 15, 2020
1 parent b71fef4 commit 9ad9bdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ let Proxy = ({urlModify, httpprefix, serverName, port, cookieDomainRewrite, loca
onError: (err, req, res) => {
console.log(`onerror: ${JSON.stringify(err)}`)
try {
if ((err.code && err.code === 'ECONNREFUSED') ||
(err.code && err.code === 'ENOTFOUND') ||
if ((err.code && (err.code === 'ECONNREFUSED'|| err.code === 'EHOSTUNREACH'|| err.code === 'EPROTO'||
err.code === 'ECONNRESET'|| err.code === 'ENOTFOUND')) ||
(err.reason && err.reason.indexOf('Expected') === -1)) {
res.status(404).send(`{"error": "${err}"}`)
}
Expand Down

0 comments on commit 9ad9bdc

Please sign in to comment.