X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=lib%2Fwebtorrent.js;h=cb641feada355df5958aaa33b7bd59f89f8b91d6;hb=ac2f99eb75ea0295dc08e47b91f4b4d54829d004;hp=5f10322a5d82953c026f9976eed9373cd50af615;hpb=a030a9b234d315c180f40d8abd177637c1a91f6a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/lib/webtorrent.js b/lib/webtorrent.js index 5f10322a5..cb641fead 100644 --- a/lib/webtorrent.js +++ b/lib/webtorrent.js @@ -43,8 +43,7 @@ function create (options, callback) { // Run a timeout of 30s after which we exit the process var timeout_webtorrent_process = setTimeout(function () { - logger.error('Timeout : cannot run the webtorrent process. Please ensure you have electron-prebuilt npm package installed with xvfb-run.') - process.exit() + throw new Error('Timeout : cannot run the webtorrent process. Please ensure you have electron-prebuilt npm package installed with xvfb-run.') }, 30000) ipc.server.on(processKey + '.ready', function () { @@ -54,8 +53,7 @@ function create (options, callback) { }) ipc.server.on(processKey + '.exception', function (data) { - logger.error('Received exception error from webtorrent process.', { exception: data.exception }) - process.exit() + throw new Error('Received exception error from webtorrent process.' + data.exception) }) var webtorrent_process = spawn(pathUtils.join(__dirname, 'webtorrentProcess.js'), host, port, { detached: true })