Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Merge pull request #60 from funerr/master
Browse files Browse the repository at this point in the history
Add verbose error message for invalid JSON input data
  • Loading branch information
dominictarr committed Mar 18, 2015
2 parents c1e4cf4 + 1e35abc commit e1bd6d1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ exports.parse = function (path, map) {
}

parser.onError = function (err) {
if(err.message.indexOf("at position") > -1)
err.message = "Invalid JSON (" + err.message + ")";
stream.emit('error', err)
}

Expand Down

0 comments on commit e1bd6d1

Please sign in to comment.