From bea13e56f8ca603aece47ec8856068f134d60e3a Mon Sep 17 00:00:00 2001 From: Daniel Evans Date: Mon, 24 Dec 2012 03:08:36 +0000 Subject: [PATCH 1/2] Modified module error output --- run.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.js b/run.js index 67911a1..8ebbdc5 100644 --- a/run.js +++ b/run.js @@ -229,7 +229,7 @@ DBot.prototype.reloadModules = function() { this.modules.push(module); } catch(err) { console.log(this.t('module_load_error', {'moduleName': name})); - console.log('MODULE ERROR: ' + name + ' ' + err); + console.log('MODULE ERROR (' + name + '): ' + err.stack ); } }.bind(this)); this.save(); From cf53413bfffd6d65c83cb9b0e07b801473f16460 Mon Sep 17 00:00:00 2001 From: Daniel Evans Date: Mon, 24 Dec 2012 03:13:41 +0000 Subject: [PATCH 2/2] Made stack trace dependant on dbot.config.debugMode --- run.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/run.js b/run.js index 8ebbdc5..26ddcea 100644 --- a/run.js +++ b/run.js @@ -229,7 +229,12 @@ DBot.prototype.reloadModules = function() { this.modules.push(module); } catch(err) { console.log(this.t('module_load_error', {'moduleName': name})); - console.log('MODULE ERROR (' + name + '): ' + err.stack ); + if(this.config.debugMode) { + console.log('MODULE ERROR (' + name + '): ' + err.stack ); + } + else { + console.log('MODULE ERROR (' + name + '): ' + err ); + } } }.bind(this)); this.save();