Permalink
Browse files

Error on broken JSON in package.json files

  • Loading branch information...
1 parent de14e7c commit f468af84e604d0036dbfeb6b31ca7b40cdac8e8b @isaacs isaacs committed Apr 16, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 fstream-npm.js
View
@@ -171,7 +171,13 @@ Packer.prototype.readRules = function (buf, e) {
return Ignore.prototype.readRules.call(this, buf, e)
}
- var p = this.package = JSON.parse(buf.toString())
+ try {
+ var p = this.package = JSON.parse(buf.toString())
+ } catch (er) {
+ er.file = path.resolve(this.path, e)
+ this.error(er)
+ return
+ }
if (this === this.root) {
this.bundleLinks = this.bundleLinks || {}

0 comments on commit f468af8

Please sign in to comment.