Show error if debug log upload fails

This commit is contained in:
Scott Nonnenberg 2018-07-19 10:21:53 -07:00
parent 4ca674edb2
commit 2ef2235317
3 changed files with 31 additions and 11 deletions

View file

@ -55,16 +55,25 @@
this.$('.buttons, textarea').remove();
this.$('.result').addClass('loading');
const publishedLogURL = await window.log.publish(text);
const view = new Whisper.DebugLogLinkView({
url: publishedLogURL,
el: this.$('.result'),
});
this.$('.loading').removeClass('loading');
view.render();
this.$('.link')
.focus()
.select();
try {
const publishedLogURL = await window.log.publish(text);
const view = new Whisper.DebugLogLinkView({
url: publishedLogURL,
el: this.$('.result'),
});
this.$('.loading').removeClass('loading');
view.render();
this.$('.link')
.focus()
.select();
} catch (error) {
console.log(
'DebugLogView error:',
error && error.stack ? error.stack : error
);
this.$('.loading').removeClass('loading');
this.$('.result').text(i18n('debugLogError'));
}
},
});
})();