Skip to content

Conversation

@roblav96
Copy link
Contributor

@roblav96 roblav96 commented May 3, 2019

A thrown SyntaxError from JSON.parse is not inside a catch block.

Example:
SyntaxError: Unexpected end of JSON input
Will exit current node process.

A thrown `SyntaxError` from `JSON.parse` is not inside a catch block.

Example:
`SyntaxError: Unexpected end of JSON input`
Will exit current node process.
Copy link
Owner

@lukeed lukeed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good catch~! 😉

@lukeed lukeed merged commit 6d47bc7 into lukeed:master May 13, 2019
@lukeed
Copy link
Owner

lukeed commented May 13, 2019

PS :: I thought it would be best to continue having a common Error format. By the time JSON.parse ran, the request already completed, which meant we already had all the data necessary to maintain the current Error formatting. Only the err.data will be empty – which makes sense since the data could not be parsed!

That change happened here: 3535f34

Thanks again 👍

@roblav96
Copy link
Contributor Author

Loving the consistency, great implementation my friend! =]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants