Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catch crashes parsin JSON #17

Open
wespen opened this issue Mar 25, 2017 · 0 comments
Open

catch crashes parsin JSON #17

wespen opened this issue Mar 25, 2017 · 0 comments

Comments

@wespen
Copy link

wespen commented Mar 25, 2017

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

ashevch pushed a commit to ashevch/forecast.io that referenced this issue Apr 26, 2017
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

No branches or pull requests

1 participant