always log errors to console

This commit is contained in:
Feross Aboukhadijeh
2016-03-20 16:11:59 -07:00
parent e4476a8f88
commit 9ecb694957

View File

@@ -53,8 +53,11 @@ function init () {
state.client.on('warning', onWarning)
state.client.on('error', function (err) {
// TODO: WebTorrent should have semantic errors
if (err.message.startsWith('There is already a swarm')) onError('Couldn\'t add duplicate torrent')
else onError(err)
if (err.message.startsWith('There is already a swarm')) {
onError(new Error('Couldn\'t add duplicate torrent'))
} else {
onError(err)
}
})
resumeTorrents() /* restart everything we were torrenting last time the app ran */
@@ -693,7 +696,7 @@ function restoreBounds () {
}
function onError (err) {
if (err.stack) console.error(err.stack)
console.error(err.stack || err)
playInterfaceSound(config.SOUND_ERROR)
state.errors.push({
time: new Date().getTime(),