forked from GitHub/dbot
Do not continue to load module if data file syntax error occurs [#466]
This commit is contained in:
parent
3148b3e434
commit
bc7bac1218
4
run.js
4
run.js
@ -186,7 +186,7 @@ DBot.prototype.reloadModules = function() {
|
||||
defaultConfig = JSON.parse(defaultConfig);
|
||||
} catch(err) { // syntax error
|
||||
this.status[name] = 'Error parsing config: ' + err + ' ' + err.stack.split('\n')[2].trim();
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
config = _.defaults(config, defaultConfig);
|
||||
} catch(err) {
|
||||
@ -220,6 +220,7 @@ DBot.prototype.reloadModules = function() {
|
||||
|
||||
process.nextTick(function() {
|
||||
_.each(moduleNames, function(name) {
|
||||
if(this.status[name] === true) {
|
||||
try {
|
||||
var moduleDir = './modules/' + name + '/';
|
||||
var rawModule = require(moduleDir + name);
|
||||
@ -301,6 +302,7 @@ DBot.prototype.reloadModules = function() {
|
||||
}
|
||||
|
||||
this.modules[module.name] = module;
|
||||
}
|
||||
}.bind(this));
|
||||
}.bind(this));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user