Account for -1 HTTPError code
This commit is contained in:
parent
c3d875305d
commit
3759fe46e9
2 changed files with 2 additions and 2 deletions
|
@ -39066,7 +39066,7 @@ window.textsecure.api = function () {
|
||||||
if (options.dataType === 'json') {
|
if (options.dataType === 'json') {
|
||||||
try { result = JSON.parse(xhr.responseText + ''); } catch(e) {}
|
try { result = JSON.parse(xhr.responseText + ''); } catch(e) {}
|
||||||
}
|
}
|
||||||
if (xhr.status < 400) {
|
if ( 0 <= xhr.status && xhr.status < 400) {
|
||||||
options.success(result, xhr.status);
|
options.success(result, xhr.status);
|
||||||
} else {
|
} else {
|
||||||
options.error(result, xhr.status);
|
options.error(result, xhr.status);
|
||||||
|
|
|
@ -77,7 +77,7 @@ window.textsecure.api = function () {
|
||||||
if (options.dataType === 'json') {
|
if (options.dataType === 'json') {
|
||||||
try { result = JSON.parse(xhr.responseText + ''); } catch(e) {}
|
try { result = JSON.parse(xhr.responseText + ''); } catch(e) {}
|
||||||
}
|
}
|
||||||
if (xhr.status < 400) {
|
if ( 0 <= xhr.status && xhr.status < 400) {
|
||||||
options.success(result, xhr.status);
|
options.success(result, xhr.status);
|
||||||
} else {
|
} else {
|
||||||
options.error(result, xhr.status);
|
options.error(result, xhr.status);
|
||||||
|
|
Loading…
Add table
Reference in a new issue