From 0c9952ce8f1631fd418a4005a224263656cb644d Mon Sep 17 00:00:00 2001 From: Andreas Taube Date: Fri, 7 Jul 2017 14:38:13 +0200 Subject: [PATCH] handle jsonparse errors consistently --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 6d68a19..4eb33c9 100755 --- a/index.js +++ b/index.js @@ -137,7 +137,7 @@ exports.parse = function (path, map) { } parser.onError = function (err) { - if(err.message.indexOf("at position") > -1) + if(err.message.indexOf("in state") > -1) err.message = "Invalid JSON (" + err.message + ")"; stream.emit('error', err) }