Skip to content

[BUG]: http error is unhandled and empty content is returned #2572

Description

@nam-truong-le

At this location https://github.com/glideapps/quicktype/blob/master/packages/quicktype-core/src/input/io/NodeIO.ts#L43 we should check the HTTP response code.

Issue Type

Reading file from URL

Context (Environment, Version, Language)

N/A

Input Format:
Output Language:

N/A

CLI, npm, or app.quicktype.io:
Version:

Description

For example, when I provide a github token like this in the cli --http-header "Authorization: token $GITHUB_TOKEN" and the token is expired, instead of throwing an error, quicktype generate empty content.

Input Data

Expected Behaviour / Output

The process should fail

Current Behaviour / Output

quicktype generates empty content.

Steps to Reproduce

Use an expired github token to access github raw URL.

Possible Solution

Check HTTP response code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions