Skip to content

Commit

Permalink
adds better errors
Browse files Browse the repository at this point in the history
  • Loading branch information
crohrer committed May 6, 2017
1 parent 7be9744 commit 3a6027a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spotifyRadioPlaylist",
"version": "2.5.0",
"version": "2.5.1",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
6 changes: 5 additions & 1 deletion radioCrawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ function getTracks(playlistName, trackserviceUrl){

resolve(tracks);
})
.close();
.close()
.catch(() => {
logger.log('error requesting trackservice.', playlistName);
reject();
});
});
}

Expand Down

0 comments on commit 3a6027a

Please sign in to comment.