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

4
run.js
View File

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