import { Code } from "./codes/codes.js"; import { ErrorDetails } from "./details.js"; //#region src/apierror/apierror.d.ts interface ApiErrorOptions { code: Code; message: string; details: ErrorDetails; httpStatusCode?: number | undefined; httpHeader?: Headers | undefined; httpBody?: Uint8Array | undefined; cause?: unknown; } /** ApiError is a transport-agnostic error representing a Databricks API error. */ declare class ApiError extends Error { /** * The error code of the error. */ readonly code: Code; /** * The structured error details of the error. This is left empty if the * error response is not a standard Databricks API error. */ readonly details: ErrorDetails; private readonly httpErr?; /** * Do not use this constructor directly. Use {@link ApiError.fromHttpError} * instead. This constructor is only meant for internal and testing use. * TODO: Make this constructor private. * * @private */ constructor(options: ApiErrorOptions); /** * Returns the ApiError's HTTP status code. If the ApiError is not an HTTP * error, returns -1. */ get httpStatusCode(): number; /** * Returns the ApiError's HTTP headers. If the ApiError is not an HTTP * error, returns undefined. */ get httpHeader(): Headers | undefined; /** * Returns the ApiError's HTTP body. If the ApiError is not an HTTP error, * returns undefined. */ get httpBody(): Uint8Array | undefined; /** * Parses an HTTP error response into an ApiError. Returns undefined if the * status code is 2xx. */ static fromHttpError(statusCode: number, header: Headers | undefined, body: Uint8Array | undefined): ApiError | undefined; } //#endregion export { ApiError }; //# sourceMappingURL=apierror.d.ts.map