[Pkg-javascript-commits] [node-jsonstream] 143/214: Add verbose error message for invalid JSON input data
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 1 12:58:51 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-jsonstream.
commit 1e35abcd6f4909d6dbb17c1171cd49bff88b41cd
Author: Agam More <agam360 at gmail.com>
Date: Tue Mar 17 23:01:02 2015 +0200
Add verbose error message for invalid JSON input data
---
index.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/index.js b/index.js
index 3313525..79e5efa 100755
--- a/index.js
+++ b/index.js
@@ -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)
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-jsonstream.git
More information about the Pkg-javascript-commits
mailing list