added a check for 502 response on publish

This commit is contained in:
bill bittner 2017-12-12 21:55:07 -08:00
parent 97eae1a183
commit 09f7ea58ac

View file

@ -123,11 +123,13 @@ const publishFileFunctions = {
xhr.open("POST", uri, true); xhr.open("POST", uri, true);
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {
if (xhr.readyState == 4) { if (xhr.readyState == 4) {
console.log('publish response:', xhr.response)
if (xhr.status == 200) { if (xhr.status == 200) {
console.log('publish complete!'); console.log('publish complete!');
that.showFilePublishComplete(JSON.parse(xhr.response).message); that.showFilePublishComplete(JSON.parse(xhr.response).message);
} else if (xhr.status == 502){
that.showFilePublishFailure('Spee.ch was not able to get a response from the LBRY network.');
} else { } else {
console.log(xhr.response);
that.showFilePublishFailure(JSON.parse(xhr.response).message); that.showFilePublishFailure(JSON.parse(xhr.response).message);
} }
} else { } else {