iink-ts - v5.0.0
    Preparing search index...

    Function parseApiError

    • Builds a TApiError from a non-2xx HTTP response, JSON-parsing the body only when the response actually declares a JSON content type. Calling response.json() unconditionally throws a confusing SyntaxError on HTML error pages, plaintext, or empty bodies (e.g. a raw 502/503 from a reverse proxy in front of the recognition server).

      Parameters

      • response: Response

      Returns Promise<TApiError>