diff --git a/packages/taro-h5/src/api/request/index.js b/packages/taro-h5/src/api/request/index.js index 8d8c88872d1b..d1810481c57b 100644 --- a/packages/taro-h5/src/api/request/index.js +++ b/packages/taro-h5/src/api/request/index.js @@ -76,6 +76,9 @@ function _request (options) { response.headers.forEach((val, key) => { res.header[key] = val }) + if(!response.ok) { + throw response + } if (options.responseType === 'arraybuffer') { return response.arrayBuffer() }