kinetex - v1.0.0-rc.1
    Preparing search index...

    Function assertOk

    • Throw an HTTPResponseError if the response status indicates an error.

      Parameters

      • response: Response

        The fetch Response to check.

      • options: { readBody?: boolean; isError?: (status: number) => boolean } = {}

        Options: readBody (default true) and custom isError predicate.

      Returns Promise<Response>

      The response unchanged if status is OK.

      If the status matches the error condition.