forked from GitHub/dbot
put onLoad in try/catch, add status message for failure. [#198]
This commit is contained in:
parent
6f73fde865
commit
e9480b6f64
6
run.js
6
run.js
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user