Skip to content

Commit

Permalink
adds more details in error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
crohrer committed Nov 12, 2017
1 parent ced5d1b commit 2296d43
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions radioCrawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -84,7 +87,7 @@ function getTracks(playlistName, trackserviceUrl){

trackserviceReq.end();
}
catch(e) {
catch(error) {
logger.log('error requesting trackservice using http.', playlistName);
reject();
}
Expand Down

0 comments on commit 2296d43

Please sign in to comment.