diff --git a/run.js b/run.js index 27bcc30..a9f202d 100644 --- a/run.js +++ b/run.js @@ -242,8 +242,6 @@ DBot.prototype.reloadModules = function() { if(propertyKey) delete require.cache[propertyKey]; propertyObj = require(moduleDir + property).fetch(this); } catch(err) { - this.status[name] = 'Error loading ' + propertyKey + - ': ' + err + ' - ' + err.stack.split('\n')[1].trim(); console.log('Module error (' + module.name + ') in ' + property + ': ' + err); } @@ -282,7 +280,13 @@ DBot.prototype.reloadModules = function() { var propertyData = {}; try { propertyData = JSON.parse(fs.readFileSync(moduleDir + property + '.json', 'utf-8')); - } catch(err) {}; + } catch(err) { + this.status[name] = 'Error loading ' + property + + ': ' + err + ' - ' + err.stack.split('\n')[1].trim(); + console.log('Data error (' + module.name + ') in ' + + property + ': ' + err); + + }; _.extend(this[property], propertyData); if(property == 'strings') { _.each(_.keys(propertyData), function(string) {