Handle some cases of api not returning full data.

This commit is contained in:
softsimon 2020-03-03 16:44:32 +07:00
parent 2b9be35afa
commit 2fe7af0c22

View File

@ -36,7 +36,11 @@ class ElectrsApi {
} else if (res.statusCode !== 200) {
reject(response);
} else {
if (response.constructor === Array) {
resolve(response);
} else {
reject('returned invalid data');
}
}
});
});
@ -50,7 +54,11 @@ class ElectrsApi {
} else if (res.statusCode !== 200) {
reject(response);
} else {
if (response.constructor === Object) {
resolve(response);
} else {
reject('returned invalid data');
}
}
});
});
@ -78,7 +86,11 @@ class ElectrsApi {
} else if (res.statusCode !== 200) {
reject(response);
} else {
if (response.constructor === Array) {
resolve(response);
} else {
reject('returned invalid data');
}
}
});
});