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,12 +123,14 @@ const publishFileFunctions = {
xhr.open("POST", uri, true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
console.log('publish response:', xhr.response)
if (xhr.status == 200) {
console.log('publish complete!');
that.showFilePublishComplete(JSON.parse(xhr.response).message);
console.log('publish complete!');
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 {
console.log(xhr.response);
that.showFilePublishFailure(JSON.parse(xhr.response).message);
that.showFilePublishFailure(JSON.parse(xhr.response).message);
}
} else {
console.log('xhr.readyState', xhr.readyState, 'xhr.status', xhr.status);