Skip to content

Commit

Permalink
fix parse json error when http is like ERR_ADDRESS_UNREACHABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
SunLn committed Sep 5, 2015
1 parent a8917b6 commit eb44ae6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions demo/js/qiniu.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,11 @@ function QiniuJsSDK() {
errTip = '文件验证失败。请稍后重试。';
break;
case plupload.HTTP_ERROR:
if (err.response === '') {
// Fix parseJSON error ,when http error is like net::ERR_ADDRESS_UNREACHABLE
errTip = err.message || '未知网络错误。';
break;
}
var errorObj = that.parseJSON(err.response);
var errorText = errorObj.error;
switch (err.status) {
Expand Down
5 changes: 5 additions & 0 deletions src/qiniu.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,11 @@ function QiniuJsSDK() {
errTip = '文件验证失败。请稍后重试。';
break;
case plupload.HTTP_ERROR:
if (err.response === '') {
// Fix parseJSON error ,when http error is like net::ERR_ADDRESS_UNREACHABLE
errTip = err.message || '未知网络错误。';
break;
}
var errorObj = that.parseJSON(err.response);
var errorText = errorObj.error;
switch (err.status) {
Expand Down
Loading

0 comments on commit eb44ae6

Please sign in to comment.