Add somewhat decent error handling finally
This commit is contained in:
parent
93370c7fe2
commit
1f0b700e82
11
bot.js
11
bot.js
@ -134,11 +134,18 @@ fs.open('./config/usersettings.json','r',function(err, fd){
|
||||
if(err) {
|
||||
console.log(err);
|
||||
}
|
||||
console.log("usersettings.json did not exist, it has been created");
|
||||
console.log("[main.setup] usersettings.json did not exist, it has been created");
|
||||
});
|
||||
fs.writeFileSync('./config/usersettings.json', "\{\n\}")
|
||||
} else {
|
||||
console.log("usersettings.json exists, continuing");
|
||||
console.log("[main] usersettings.json exists, continuing");
|
||||
}
|
||||
});
|
||||
console.log('[main.irc] Connecting to '+config.irc.server+'/'+config.irc.port+' as '+config.irc.nickname);
|
||||
|
||||
process.on('uncaughtException', function (err) {
|
||||
console.error(err);
|
||||
if (config.errorhandling.log_errors_to_irc == 'true') {
|
||||
bot.say(config.errorhandling.error_channel, errorMsg+" "+err.stack.split('\n',1).join(" "))
|
||||
}
|
||||
});
|
@ -8,12 +8,17 @@
|
||||
],
|
||||
"nickname": "mercury",
|
||||
"username": "mercury",
|
||||
"realname": "git.supernets.org/hogwart7/mercury",
|
||||
"realname": "git.supernets.org/hgw/mercury",
|
||||
"autorejoin": "true",
|
||||
"floodprotection": "false",
|
||||
"floodprotectiondelay": "0",
|
||||
"prefix": "m!"
|
||||
},
|
||||
"errorhandling": {
|
||||
"error_logging": "true",
|
||||
"error_channel": "#CHANNELTOSENDERRORSTO",
|
||||
"error_channel_pass": ""
|
||||
},
|
||||
"colours": {
|
||||
"date": "11",
|
||||
"brackets": "15",
|
||||
|
Loading…
Reference in New Issue
Block a user