Skip to content

catch crashes parsin JSON #17

@wespen

Description

@wespen
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions