From 2296d43eb8719b7d203663b7b32ce959dbd1a556 Mon Sep 17 00:00:00 2001 From: Christoph Rohrer Date: Sun, 12 Nov 2017 11:47:54 +0100 Subject: [PATCH] adds more details in error logging --- radioCrawler.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/radioCrawler.js b/radioCrawler.js index 9ef567b..ae72f98 100644 --- a/radioCrawler.js +++ b/radioCrawler.js @@ -48,8 +48,11 @@ function getTracks(playlistName, trackserviceUrl){ .html() .then(searchInHtml) .then((tracks) => resolve(tracks)) - .catch(() => { + .catch(e => { logger.log('error requesting trackservice using horseman.', playlistName); + if(e){ + logger.log(e, playlistName) + } try { let httpx = (URL.parse(url).protocol === 'http:') ? http : https; let trackserviceReq = httpx.request(url, function(res) { @@ -84,7 +87,7 @@ function getTracks(playlistName, trackserviceUrl){ trackserviceReq.end(); } - catch(e) { + catch(error) { logger.log('error requesting trackservice using http.', playlistName); reject(); }