diff --git a/main.js b/main.js index e6c90b1..3c8ca79 100644 --- a/main.js +++ b/main.js @@ -23,7 +23,11 @@ function start(){ .then(radioTracks => radioCrawler.cleanTracks(radioTracks)) .then(cleanedTracks => spotifySearch.searchTracks(cleanedTracks)) .then(newTracks => spotifyPlaylist.addTracks(playlistName, newTracks)) - .then(process.exit); + .then(process.exit) + .catch(() => { + logger.log('exited due to error.', playlistName); + process.exit(); + }); } module.exports = { diff --git a/package.json b/package.json index 12998f7..ad75916 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "spotifyRadioPlaylist", - "version": "2.5.0", + "version": "2.5.1", "license": "MIT", "repository": { "type": "git", diff --git a/radioCrawler.js b/radioCrawler.js index c0ac2e0..01e0011 100644 --- a/radioCrawler.js +++ b/radioCrawler.js @@ -84,7 +84,11 @@ function getTracks(playlistName, trackserviceUrl){ resolve(tracks); }) - .close(); + .close() + .catch(() => { + logger.log('error requesting trackservice.', playlistName); + reject(); + }); }); }