UNPKG

@tai-kun/surrealdb

Version:

The SurrealDB SDK for JavaScript

50 lines 2.13 kB
import { SurrealAggregateError, SurrealError, type SurrealErrorOptions } from "./general"; export interface EngineSurrealErrorOptions extends SurrealErrorOptions { readonly fatal?: boolean | undefined; } /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/errors/#engineerror) */ export declare class EngineError extends SurrealError { fatal: boolean | undefined; constructor(message: string, options?: EngineSurrealErrorOptions | undefined); } /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/errors/#httpengineerror) */ export declare class HttpEngineError extends EngineError { constructor(message: string, options?: EngineSurrealErrorOptions | undefined); } export declare namespace WebSocketEngineStatusCode { type Defined = 1002 | 1003 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014; type Custom = 3150 | 3151 | 3152 | 3153 | 3154; } /** * {@link WebSocketEngineError} */ export type WebSocketEngineStatusCode = WebSocketEngineStatusCode.Defined | WebSocketEngineStatusCode.Custom; /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/errors/#websocketengineerror) */ export declare class WebSocketEngineError extends EngineError { code: WebSocketEngineStatusCode; constructor(code: WebSocketEngineStatusCode, message: string, options?: EngineSurrealErrorOptions | undefined); } /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/errors/#statetransitionerror) */ export declare class StateTransitionError extends SurrealAggregateError { from: string; to: string; fallback: string; constructor(from: string, to: string, fallback: string, errors: readonly unknown[], options?: Omit<SurrealErrorOptions, "cause"> | undefined); } /** * [API Reference](https://tai-kun.github.io/surrealdb.js/v2/guides/errors/#connectionunavailableerror) */ export declare class ConnectionUnavailableError extends SurrealError { constructor(options?: SurrealErrorOptions | undefined); } export declare class ServerResponseError extends SurrealError { } //# sourceMappingURL=engine.d.ts.map