Additional error information when JSON config file cannot be read

This commit is contained in:
Marcin Floryan 2013-04-29 16:34:48 +01:00 committed by Marcin Floryan
parent 818526ca62
commit 0135d95a06

View file

@ -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 + '].');
}
}