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

    Function assertOkJSON

    • Throw if response is not 2xx. Variant that parses error body as JSON.

      Type Parameters

      • E = unknown

      Parameters

      • response: Response

        The fetch Response to check.

      Returns Promise<{ response: Response; errorBody?: E }>

      An object containing response (the original Response if ok) and optionally errorBody (parsed JSON error body).

      If the response is not ok.