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

JSON.parse error reporting: with invalid json: in the error string #1001

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils/stream-to-json-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function streamToJsonValue (res, cb) {
try {
res = JSON.parse(data)
} catch (err) {
return cb(err)
return cb(new Error(`Invalid JSON: ${data}`))
}

cb(null, res)
Expand Down