IFClite TypeScript API
    Preparing search index...

    A non-2xx answer from the server.

    Every error the server writes is the { error, code } envelope (ErrorResponse); code is its stable identifier (NOT_FOUND, BAD_REQUEST, UNAUTHORIZED, OVERLOADED, ...) and is what to branch on. A body that is not the envelope (a proxy in front of the server answered, or a server older than the envelope's coverage of every status) still yields this error, with code set to HTTP_<status>.

    try {
    await client.getCached(key);
    } catch (error) {
    if (error instanceof IfcServerError && error.code === 'OVERLOADED') {
    // retry later
    }
    }

    Hierarchy

    • Error
      • IfcServerError
    Index
    • Parameters

      • message: string
      • status: number
      • code: string

      Returns IfcServerError

    code: string

    The envelope's code, or HTTP_<status> when the body was not the envelope.

    status: number

    HTTP status of the response.