JSON.parse will throw an exception if it's given a string that isn't valid JSON. This will be rare when dealing with an API like Github's, but it's best to be sure, especially if that error will prevent you from responding to the client, or take down your server entirely:
JSON.parse
will throw an exception if it's given a string that isn't valid JSON. This will be rare when dealing with an API like Github's, but it's best to be sure, especially if that error will prevent you from responding to the client, or take down your server entirely:https://github.com/fac-13/jeth/blob/55aa475205ea69a649432a9c9cfd0b7e1854d083/src/handlers.js#L47
Or prevent your client-side code from updating the UI to let your user know what's happened:
https://github.com/fac-13/jeth/blob/55aa475205ea69a649432a9c9cfd0b7e1854d083/public/dom.js#L7
You'll need to use
try
/catch
.