import type { IssueMessage } from '../../types/api/query'; export interface ErrorDetails { status?: number; statusText?: string; /** Brief error title for display: "{status} {statusText}" or "Network Error" */ title?: string; /** Raw error.message for diagnostics (shown when differs from title and dataMessage) */ message?: string; /** Specific error message extracted from response data (data.error, data.message, etc.) */ dataMessage?: string; traceId?: string; requestId?: string; proxyName?: string; workerName?: string; proxyTraceId?: string; proxyRequestId?: string; proxyRewrittenPath?: string; proxyTarget?: string; errorOrigin?: 'app' | 'proxy' | 'upstream'; errorStage?: string; requestUrl?: string; method?: string; errorCode?: string; grpcCode?: number; responseBody?: string; hasIssues?: boolean; issues?: IssueMessage[]; /** Where the error occurred: 'connection' or 'stream' */ errorPhase?: 'connection' | 'stream'; /** Network state at the time of error */ networkOnline?: boolean; networkEffectiveType?: string; } export declare const USEFUL_HEADERS: readonly [{ readonly header: "traceresponse"; readonly key: "traceId"; readonly transform: typeof extractTraceIdFromTraceresponse; }, { readonly header: "x-trace-id"; readonly key: "traceId"; readonly transform: undefined; }, { readonly header: "x-request-id"; readonly key: "requestId"; readonly transform: undefined; }, { readonly header: "x-proxy-name"; readonly key: "proxyName"; readonly transform: undefined; }, { readonly header: "x-worker-name"; readonly key: "workerName"; readonly transform: undefined; }]; declare const PROXY_HEADERS: readonly [{ readonly header: "x-ydb-ui-proxy-trace-id"; readonly key: "proxyTraceId"; }, { readonly header: "x-ydb-ui-proxy-request-id"; readonly key: "proxyRequestId"; }, { readonly header: "x-ydb-ui-proxy-rewritten-path"; readonly key: "proxyRewrittenPath"; }, { readonly header: "x-ydb-ui-proxy-target"; readonly key: "proxyTarget"; }]; declare const ERROR_MARKER_HEADERS: readonly [{ readonly header: "x-ydb-ui-error-origin"; readonly key: "errorOrigin"; }, { readonly header: "x-ydb-ui-error-stage"; readonly key: "errorStage"; }]; type ExtractableResponseHeader = (typeof USEFUL_HEADERS)[number]['header'] | (typeof PROXY_HEADERS)[number]['header'] | (typeof ERROR_MARKER_HEADERS)[number]['header']; export declare const EXTRACTABLE_RESPONSE_HEADERS: ExtractableResponseHeader[]; declare function extractTraceIdFromTraceresponse(value: string): string; export declare function extractDataMessage(data: unknown): string | undefined; /** * Extracts metadata details from error objects for display in error UI. * Works with HTTP errors (from AxiosWrapper response), network errors (from AxiosWrapper toJSON), * and response errors with issues (HTTP 429). * * Returns null for primitives, cancelled requests, and objects without useful metadata. */ export declare function extractErrorDetails(error: unknown): ErrorDetails | null; export {};