Skip to content

Guard against JSON parsing errors #8

@BrendanDavies

Description

@BrendanDavies

Currently in the onSuccess handler, there is a catch function for reading the JSON response, that tries to read the stream again (via .text()) here.

This causes any possible parsing error to be masked by a TypeError: body stream already read since we are trying to read a stream twice.

The catch function should be refactored to guard against the body already being streamed !response.bodyUsed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions