From 54c4b66e9ba6df25c4f637ff053ee144ff67ba9e Mon Sep 17 00:00:00 2001 From: Andreas Marschke Date: Sat, 7 Sep 2013 08:49:05 +0200 Subject: [PATCH 1/2] lib/index.js: add warnings in case parsing the config fails --- lib/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index c90a85c..103973c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -39,10 +39,14 @@ function loadConfFiles(files) { try { contents = require(path.join(confDir, file + '.json')); } catch (e) { + if (e.code !== "MODULE_NOT_FOUND" ) { + console.warn("Warning: "); + } try { contents = require(path.join(confDir, file + '.js')); } catch (e2) { - contents = { }; + console.warn("Warning: ", e2); + contents = { }; } } return contents; From cd65ecb7af0464004b7cf0dcc7d8662affefc08d Mon Sep 17 00:00:00 2001 From: Andreas Marschke Date: Sat, 7 Sep 2013 08:51:24 +0200 Subject: [PATCH 2/2] fix whitespace --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 103973c..c328f0b 100644 --- a/lib/index.js +++ b/lib/index.js @@ -46,7 +46,7 @@ function loadConfFiles(files) { contents = require(path.join(confDir, file + '.js')); } catch (e2) { console.warn("Warning: ", e2); - contents = { }; + contents = { }; } } return contents;