Added more error-messages on crashing because of missing files. Closes #227

This commit is contained in:
Kasper Rynning-Tønnesen
2017-11-10 16:23:45 +01:00
parent f047ae1e1f
commit 814e1eaac9
5 changed files with 121 additions and 107 deletions

View File

@@ -1,6 +1,12 @@
var path = require('path');
var time_regex = /P((([0-9]*\.?[0-9]*)Y)?(([0-9]*\.?[0-9]*)M)?(([0-9]*\.?[0-9]*)W)?(([0-9]*\.?[0-9]*)D)?)?(T(([0-9]*\.?[0-9]*)H)?(([0-9]*\.?[0-9]*)M)?(([0-9]*\.?[0-9]*)S)?)?/;
var key = require(path.join(__dirname, '../config/api_key.js'));
try {
var key = require(path.join(__dirname, '../config/api_key.js'));
} catch(e) {
console.log("Error - missing file");
console.log("Seems you forgot to create the file api_key.js in /server/config/. Have a look at api_key.example.js.");
process.exit();
}
function get_correct_info(song_generated, channel, broadcast) {
request({