Added more verbose for errors

This commit is contained in:
dbroqua 2019-12-17 11:06:56 +01:00
parent 2617a4ed19
commit 19588c67d6
3 changed files with 11 additions and 5 deletions

View file

@ -1,5 +1,5 @@
const moment = require('moment')
const libs = require('./libs') const libs = require('./libs')
const config = require('./config') const config = require('./config')
setInterval(() => { setInterval(() => {
@ -9,7 +9,7 @@ setInterval(() => {
// On récupére en base le précédent morceau joué // On récupére en base le précédent morceau joué
libs.getLastSong((err, last) => { libs.getLastSong((err, last) => {
if (err) { if (err) {
console.log(err) console.log('[ERR] GET LAST SONG:', moment().format(), err)
return false return false
} }
@ -20,14 +20,14 @@ setInterval(() => {
// On sauvegarde en base le morceau en cours de diffusion // On sauvegarde en base le morceau en cours de diffusion
libs.saveSong(currentSong, (err, savedSond) => { libs.saveSong(currentSong, (err, savedSond) => {
if (err) { if (err) {
console.log('ERR:', err) console.log('[ERR] SAVE SONG:', moment().format(), err)
return false return false
} }
// On récupère la cover du morceau actuel // On récupère la cover du morceau actuel
libs.findCover(currentSong, (err, coverUrl) => { libs.findCover(currentSong, (err, coverUrl) => {
if (err) { if (err) {
console.log('ERR:', err) console.log('[ERR] FIND COVER:', moment().format(), err)
return false return false
} }

View file

@ -8,6 +8,7 @@
"dependencies": { "dependencies": {
"disconnect": "^1.2.1", "disconnect": "^1.2.1",
"mastodon": "^1.2.2", "mastodon": "^1.2.2",
"moment": "^2.24.0",
"mongoose": "^5.7.13", "mongoose": "^5.7.13",
"request": "^2.88.0" "request": "^2.88.0"
}, },
@ -20,4 +21,4 @@
"eslint-plugin-standard": "^4.0.1", "eslint-plugin-standard": "^4.0.1",
"nodemon": "^2.0.1" "nodemon": "^2.0.1"
} }
} }

View file

@ -1280,6 +1280,11 @@ mkdirp@^0.5.1:
dependencies: dependencies:
minimist "0.0.8" minimist "0.0.8"
moment@^2.24.0:
version "2.24.0"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"
integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==
mongodb@3.3.5: mongodb@3.3.5:
version "3.3.5" version "3.3.5"
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.3.5.tgz#38d531013afede92b0dd282e3b9f3c08c9bdff3b" resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.3.5.tgz#38d531013afede92b0dd282e3b9f3c08c9bdff3b"