3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-28 05:32:50 +01:00

put onLoad in try/catch, add status message for failure. [#198]

This commit is contained in:
reality 2013-01-24 21:46:18 +00:00
parent 6f73fde865
commit e9480b6f64

6
run.js
View File

@ -294,7 +294,11 @@ DBot.prototype.reloadModules = function() {
_.each(this.modules, function(module, name) {
if(module.onLoad) {
module.onLoad();
try {
module.onLoad();
} catch(err) {
this.status[name] = 'Error in onLoad: ' + err + ' ' + err.stack.split('\n')[1].trim();
}
}
}, this);