Improve error message while reading the json.

This commit is contained in:
André Cruz
2012-12-03 08:33:53 +00:00
parent f9f3ee1d06
commit 88843bf855

View File

@@ -277,7 +277,10 @@ Package.prototype.loadJSON = function () {
}
readJSON(jsonFile, function (err, json) {
if (err) return this.emit('error', err);
if (err) {
err.details = 'There was an error while reading the ' + config.json;
return this.emit('error', err);
}
this.json = json;
this.version = this.commit || json.commit || json.version;