/** * Error thrown by {@link EngineServicesClient} when the platform API responds * with a non-2xx status. Exposes the HTTP `status` and — when the API returns a * structured JSON body — its `code` and `details`, so callers can react to * specific failures (e.g. `code === 'LIMIT_EXCEEDED'`) instead of string- * matching the message. * * @example * ```ts * try { * await client.createComponent(props); * } catch (err) { * if (err instanceof RequestError && err.code === 'LIMIT_EXCEEDED') { * console.error(err.message); // "Components limit reached (10/10)..." * } * } * ``` * * @example Rate limiting * ```ts * catch (err) { * if (err instanceof RequestError && err.status === 429) { * console.log(err.code); // "RATE_LIMITED" * console.log(err.details); // { limit, windowSeconds, retryAfter, scope } * console.log(err.retryAfter); // seconds to wait before trying again * } * } * ``` */ export declare class RequestError extends Error { readonly status: number; readonly code?: string; readonly details?: unknown; readonly body: string; /** * Seconds to wait before retrying, taken from the `Retry-After` header or * from `details.retryAfter`. Only present on rate-limited (429) responses. */ readonly retryAfter?: number; constructor(status: number, statusText: string, body: string, retryAfter?: number); }