@evlmaistrenko/tools-fetch
    Preparing search index...

    Class ResponseError

    Implementation with some basic parsing

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    parsedValue?: { message?: string }

    Store for parsed response body

    response: Response

    Corresponded response

    Accessors

    • get parsed(): undefined | TParsed

      Parsed response body. In general available only after executing this.parse

      Returns undefined | TParsed

    Methods

    • Checks response for errors

      Parameters

      • response: Response

        Response to check

      • parse: boolean = true

        Whether to parse response body

      Returns Promise<Response>

      Response

      await fetch("<some-url>").then((error) => ResponseError.check(error))