/** * Parse an Entropy Softworks server error response into a single user- * facing string. Falls back to `fallback` when the body isn't valid * JSON or doesn't follow the expected `{ error: { message, details? } }` * shape. Detail arrays longer than `MAX_DETAILS` are truncated so a * runaway server response can't produce an unreadable toast. */ export interface ServerErrorBody { error: { message: string; details?: string[]; code?: string; }; } /** * Error subclass that carries the server's machine-readable * `error.code` and HTTP `status` alongside the human-readable * message. UI code can branch on `code` (e.g. `INVALID_CREDENTIALS`, * `ACCOUNT_LOCKED`, `EMAIL_NOT_VERIFIED`) instead of substring- * matching against an English message that breaks under i18n. */ export declare class ApiError extends Error { readonly code: string | undefined; readonly status: number; readonly details: readonly string[] | undefined; constructor(message: string, options: { code?: string; status: number; details?: readonly string[]; }); } export declare function extractErrorMessage(response: Response, fallback: string): Promise; /** * Like `extractErrorMessage` but returns a structured `ApiError` so * callers can branch on `code` / `status`. Use this when the caller * is throwing and downstream consumers need machine-readable * classification; use `extractErrorMessage` when all you need is a * toast string. */ export declare function extractApiError(response: Response, fallback: string): Promise; //# sourceMappingURL=http-error.d.ts.map