Skip to content

Commit

Permalink
Backend logging for #59
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbarrow committed Sep 21, 2017
1 parent 0956323 commit 6e1ca62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 32 deletions.
10 changes: 7 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,14 @@ function getSuggested(most_played, cb) {
genres.push(most_played[i].genres[Math.floor(Math.random() * most_played[i].genres.length)]);
}
request(API_ROOT + '/api/v2/GetSuggested/' + genres.join('|'), (error, response, body) => {
if (error) return cb(null, {});
body = JSON.parse(body);
if (error || response.statusCode !== 200 || !body || body.error) return callback(true);
return cb(null, body);
console.log(body)
try {
body = JSON.parse(body);
return cb(null, body);
} catch (error) {
return callback(true);
}
});
}

Expand Down
29 changes: 0 additions & 29 deletions cemui.error.log

This file was deleted.

0 comments on commit 6e1ca62

Please sign in to comment.