Skip to content

Commit

Permalink
fix(taro-h5): 响应体无数据时抛错进入reject (NervJS#4599)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrReMain authored and luckyadam committed Oct 21, 2019
1 parent 351c0ac commit 84ce3ef
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/taro-h5/src/api/request/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 84ce3ef

Please sign in to comment.