Skip to content

Commit

Permalink
add case for other http errors
Browse files Browse the repository at this point in the history
  • Loading branch information
frosty00 committed Aug 18, 2019
1 parent 4b2555c commit 77a95e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/base/Exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ module.exports = class Exchange {

defaultErrorHandler (code, reason, url, method, headers, body, response) {
let details = body
let ErrorClass = this.httpExceptions[code.toString ()]
let ErrorClass = this.httpExceptions[code.toString ()] || (code < 200 || code > 299) ? ExchangeError : undefined
if (response === undefined) {
const maintenance = body.match (/offline|busy|retry|wait|unavailable|maintain|maintenance|maintenancing/i)
const ddosProtection = body.match (/cloudflare|incapsula|overload|ddos/i)
Expand Down

0 comments on commit 77a95e5

Please sign in to comment.