Skip to content

Crash if invalid JSON is returned #1

@JacenBoy

Description

@JacenBoy

node-kitsu seems to assume that the Kitsu API will always return a proper JSON response. If the API does not return a proper JSON response, a syntax error is thrown during the parsing of the response.

I am currently using async/await syntax wrapped in a try/catch, and the syntax error seems to occur outside of my try/catch, causing the app to crash.

The issue can be recreated if a request is made while Kitsu is experiencing some kind of downtime. Rather than a JSON response, the API returns an HTML error page, causing the issue.

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