Permalink
Browse files

Better error reporting of invalid package.json files.

  • Loading branch information...
tobie committed Jan 5, 2012
1 parent 2b4561a commit 5078bafb5a19cb704ff1a03eda557a14973b2bab
Showing with 3 additions and 0 deletions.
  1. +3 −0 main.js
View
@@ -40,6 +40,9 @@ exports.buildFromPackage = function(p, configCallback, callback) {
}
jsonFs.readFile(packageFile, function(err, json) {
if (err) {
+ err.file = packageFile;
+ err.longDesc = err.toString() + '. Malformed JSON in descriptor file:\n ' + packageFile;
+ err.toString = function() { return err.longDesc; };
callback(err);
} else {
var config = json.modulr || {};

0 comments on commit 5078baf

Please sign in to comment.