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