From bd84d42235ea697feac2b8d9a92124111c0b3d25 Mon Sep 17 00:00:00 2001 From: AK Date: Thu, 17 Aug 2023 23:22:03 -0400 Subject: [PATCH] forward input + reviver to errorIndicator when your stream encounters parsing errors, you may want access to the raw value. --- jsonl/Parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonl/Parser.js b/jsonl/Parser.js index 409b76b..9b0e403 100644 --- a/jsonl/Parser.js +++ b/jsonl/Parser.js @@ -11,7 +11,7 @@ class JsonlParser extends Utf8Stream { try { return JSON.parse(input, reviver); } catch (error) { - if (typeof errorIndicator == 'function') return errorIndicator(error); + if (typeof errorIndicator == 'function') return errorIndicator(error, input, reviver); } return errorIndicator; }