From 0135d95a06eb4da5673a9cb935a18c67fcb9b25a Mon Sep 17 00:00:00 2001 From: Marcin Floryan Date: Mon, 29 Apr 2013 16:34:48 +0100 Subject: [PATCH] Additional error information when JSON config file cannot be read --- lib/nconf/stores/file.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nconf/stores/file.js b/lib/nconf/stores/file.js index 117f5ab..65ccfa3 100644 --- a/lib/nconf/stores/file.js +++ b/lib/nconf/stores/file.js @@ -100,7 +100,7 @@ File.prototype.load = function (callback) { self.store = self.format.parse(data.toString()); } catch (ex) { - return callback(new Error("Error parsing your JSON configuration file.")); + return callback(new Error("Error parsing your JSON configuration file: [" + self.file + '].')); } callback(null, self.store); @@ -129,7 +129,7 @@ File.prototype.loadSync = function () { this.store = data; } catch (ex) { - throw new Error("Error parsing your JSON configuration file.") + throw new Error("Error parsing your JSON configuration file: [" + self.file + '].'); } }