/** * Typed error hierarchy raised by the Introspection SDK. * * All HTTP errors extend `IntrospectionAPIError` and carry `status`, * `requestId`, `code`, `body`, and `retryAfter`. Specific subclasses are * picked from the combination of HTTP status + the `code` field on the JSON * error body so callers can `instanceof`-discriminate the common failure modes. * * Unknown 4xx/5xx codes fall through to the base `IntrospectionAPIError`. */ export declare class IntrospectionAPIError extends Error { readonly status: number; readonly code: string | null; readonly requestId: string | null; readonly body: unknown; /** `Retry-After` hint (seconds) from the response, when the server sent one. */ readonly retryAfter: number | null; constructor(opts: { message: string; status: number; code?: string | null; requestId?: string | null; body?: unknown; retryAfter?: number | null; }); } /** 401 — auth missing / invalid. */ export declare class AuthenticationError extends IntrospectionAPIError { constructor(opts: ConstructorParameters[0]); } /** 403 with `code: "insufficient_scope"` — auth was valid but lacks a capability. */ export declare class InsufficientScopeError extends IntrospectionAPIError { readonly missingCapability: string | null; constructor(opts: ConstructorParameters[0] & { missingCapability?: string | null; }); } /** 401 with `code: "runner_expired"` — the runner JWT is expired or revoked. */ export declare class RunnerExpiredError extends IntrospectionAPIError { constructor(opts: ConstructorParameters[0]); } /** 404. */ export declare class NotFoundError extends IntrospectionAPIError { constructor(opts: ConstructorParameters[0]); } /** 409. */ export declare class ConflictError extends IntrospectionAPIError { constructor(opts: ConstructorParameters[0]); } /** 400 / 422 — request shape was rejected by the server. */ export declare class ValidationError extends IntrospectionAPIError { constructor(opts: ConstructorParameters[0]); } /** 429. Carries the `retryAfter` hint (seconds) from `Retry-After`, inherited * from {@link IntrospectionAPIError}. */ export declare class RateLimitError extends IntrospectionAPIError { constructor(opts: ConstructorParameters[0]); } /** 503 / 504 — DP sandbox is unreachable / not warm. */ export declare class SandboxUnavailableError extends IntrospectionAPIError { constructor(opts: ConstructorParameters[0]); } /** Transport failure before any HTTP response (DNS, TLS, abort, etc.). */ export declare class NetworkError extends IntrospectionAPIError { constructor(opts: Omit[0], "status"> & { status?: number; }); } interface ErrorMappingInput { status: number; message: string; code: string | null; requestId: string | null; body: unknown; retryAfter?: number | null; } /** * Construct the most specific `IntrospectionAPIError` subclass for the * given response. Used by the HTTP client to translate non-2xx responses * before throwing. */ export declare function apiErrorFromResponse(input: ErrorMappingInput): IntrospectionAPIError; export {}; //# sourceMappingURL=errors.d.ts.map