diff --git a/lib/functions/fetch.js b/lib/functions/fetch.js index e88461f..461bb2b 100644 --- a/lib/functions/fetch.js +++ b/lib/functions/fetch.js @@ -15,7 +15,8 @@ export default function fetch(path, data = {}) { .field(data) .attach(files) .end(response => { - if (response.statusType === 4 || response.statusType === 5) { + if (response.statusType === 4 || response.statusType === 5 || + !response.body.ok) { reject(response); } else { resolve(response.body);