forecast.io icon indicating copy to clipboard operation
forecast.io copied to clipboard

catch crashes parsin JSON

Open wespen opened this issue 7 years ago • 0 comments

SyntaxError: Unexpected token F in JSON at position 0
    at JSON.parse (<anonymous>)
    at Request._callback (/node_modules/forecast.io/index.js:79:19)

I guess thats from 403 or something, but the app crashes.

Can you put try catch in JSON.parse so it doesnt crash the app. There is a fix from @danschumann in a pull request or you can just copy paste that 3 lines

wespen avatar Mar 25 '17 16:03 wespen