From 9ecb694957860bf89530e2c40ca7fd8ec76754ff Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 20 Mar 2016 16:11:59 -0700 Subject: [PATCH] always log errors to console --- renderer/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/renderer/index.js b/renderer/index.js index 8de6671b..44c48176 100644 --- a/renderer/index.js +++ b/renderer/index.js @@ -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(),