Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit d7e4fd6

Browse files
KrishnaPGAlan Shaw
authored and
Alan Shaw
committed
Update stream-to-json-value.js
Better error reporting in case of `json.parse` failures
1 parent a28b009 commit d7e4fd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/stream-to-json-value.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function streamToJsonValue (res, cb) {
2424
try {
2525
res = JSON.parse(data)
2626
} catch (err) {
27-
return cb(err)
27+
return cb(new Error(`Invalid JSON: ${data}`))
2828
}
2929

3030
cb(null, res)

0 commit comments

Comments
 (0)