diff --git a/lib/ovh.es5.js b/lib/ovh.es5.js index 209f314..71d4cd7 100644 --- a/lib/ovh.es5.js +++ b/lib/ovh.es5.js @@ -401,7 +401,7 @@ var Ovh = function () { _this2.debug('[OVH] API response to', options.method, options.path, ':', body); } - if (res.statusCode !== 200) { + if (res.statusCode > 299 || res.statusCode < 200) { callback(res.statusCode, response ? response.message : response); } else { // Return a proxy (for potential next request) diff --git a/lib/ovh.es6.js b/lib/ovh.es6.js index 3d0013b..dfe794f 100644 --- a/lib/ovh.es6.js +++ b/lib/ovh.es6.js @@ -405,7 +405,7 @@ class Ovh { ); } - if (res.statusCode !== 200) { + if (res.statusCode > 299 || res.statusCode < 200) { callback(res.statusCode, response ? response.message : response); } else { @@ -487,4 +487,4 @@ class Ovh { module.exports = function (params) { return new Ovh(params || {}); -}; \ No newline at end of file +};