1 line
8.1 KiB
JSON
1 line
8.1 KiB
JSON
{"ast":null,"code":"/** Generic error produced by the Hrana client. */\nexport class ClientError extends Error {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"ClientError\";\n }\n}\n/** Error thrown when the server violates the protocol. */\nexport class ProtoError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"ProtoError\";\n }\n}\n/** Error thrown when the server returns an error response. */\nexport class ResponseError extends ClientError {\n code;\n /** @internal */\n proto;\n /** @private */\n constructor(message, protoError) {\n super(message);\n this.name = \"ResponseError\";\n this.code = protoError.code;\n this.proto = protoError;\n this.stack = undefined;\n }\n}\n/** Error thrown when the client or stream is closed. */\nexport class ClosedError extends ClientError {\n /** @private */\n constructor(message, cause) {\n if (cause !== undefined) {\n super(`${message}: ${cause}`);\n this.cause = cause;\n } else {\n super(message);\n }\n this.name = \"ClosedError\";\n }\n}\n/** Error thrown when the environment does not seem to support WebSockets. */\nexport class WebSocketUnsupportedError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"WebSocketUnsupportedError\";\n }\n}\n/** Error thrown when we encounter a WebSocket error. */\nexport class WebSocketError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"WebSocketError\";\n }\n}\n/** Error thrown when the HTTP server returns an error response. */\nexport class HttpServerError extends ClientError {\n status;\n /** @private */\n constructor(message, status) {\n super(message);\n this.status = status;\n this.name = \"HttpServerError\";\n }\n}\n/** Error thrown when a libsql URL is not valid. */\nexport class LibsqlUrlParseError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"LibsqlUrlParseError\";\n }\n}\n/** Error thrown when the protocol version is too low to support a feature. */\nexport class ProtocolVersionError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"ProtocolVersionError\";\n }\n}\n/** Error thrown when an internal client error happens. */\nexport class InternalError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"InternalError\";\n }\n}\n/** Error thrown when the API is misused. */\nexport class MisuseError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"MisuseError\";\n }\n}","map":{"version":3,"names":["ClientError","Error","constructor","message","name","ProtoError","ResponseError","code","proto","protoError","stack","undefined","ClosedError","cause","WebSocketUnsupportedError","WebSocketError","HttpServerError","status","LibsqlUrlParseError","ProtocolVersionError","InternalError","MisuseError"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/@libsql/hrana-client/lib-esm/errors.js"],"sourcesContent":["/** Generic error produced by the Hrana client. */\nexport class ClientError extends Error {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"ClientError\";\n }\n}\n/** Error thrown when the server violates the protocol. */\nexport class ProtoError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"ProtoError\";\n }\n}\n/** Error thrown when the server returns an error response. */\nexport class ResponseError extends ClientError {\n code;\n /** @internal */\n proto;\n /** @private */\n constructor(message, protoError) {\n super(message);\n this.name = \"ResponseError\";\n this.code = protoError.code;\n this.proto = protoError;\n this.stack = undefined;\n }\n}\n/** Error thrown when the client or stream is closed. */\nexport class ClosedError extends ClientError {\n /** @private */\n constructor(message, cause) {\n if (cause !== undefined) {\n super(`${message}: ${cause}`);\n this.cause = cause;\n }\n else {\n super(message);\n }\n this.name = \"ClosedError\";\n }\n}\n/** Error thrown when the environment does not seem to support WebSockets. */\nexport class WebSocketUnsupportedError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"WebSocketUnsupportedError\";\n }\n}\n/** Error thrown when we encounter a WebSocket error. */\nexport class WebSocketError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"WebSocketError\";\n }\n}\n/** Error thrown when the HTTP server returns an error response. */\nexport class HttpServerError extends ClientError {\n status;\n /** @private */\n constructor(message, status) {\n super(message);\n this.status = status;\n this.name = \"HttpServerError\";\n }\n}\n/** Error thrown when a libsql URL is not valid. */\nexport class LibsqlUrlParseError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"LibsqlUrlParseError\";\n }\n}\n/** Error thrown when the protocol version is too low to support a feature. */\nexport class ProtocolVersionError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"ProtocolVersionError\";\n }\n}\n/** Error thrown when an internal client error happens. */\nexport class InternalError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"InternalError\";\n }\n}\n/** Error thrown when the API is misused. */\nexport class MisuseError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"MisuseError\";\n }\n}\n"],"mappings":"AAAA;AACA,OAAO,MAAMA,WAAW,SAASC,KAAK,CAAC;EACnC;EACAC,WAAWA,CAACC,OAAO,EAAE;IACjB,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,aAAa;EAC7B;AACJ;AACA;AACA,OAAO,MAAMC,UAAU,SAASL,WAAW,CAAC;EACxC;EACAE,WAAWA,CAACC,OAAO,EAAE;IACjB,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,YAAY;EAC5B;AACJ;AACA;AACA,OAAO,MAAME,aAAa,SAASN,WAAW,CAAC;EAC3CO,IAAI;EACJ;EACAC,KAAK;EACL;EACAN,WAAWA,CAACC,OAAO,EAAEM,UAAU,EAAE;IAC7B,KAAK,CAACN,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,eAAe;IAC3B,IAAI,CAACG,IAAI,GAAGE,UAAU,CAACF,IAAI;IAC3B,IAAI,CAACC,KAAK,GAAGC,UAAU;IACvB,IAAI,CAACC,KAAK,GAAGC,SAAS;EAC1B;AACJ;AACA;AACA,OAAO,MAAMC,WAAW,SAASZ,WAAW,CAAC;EACzC;EACAE,WAAWA,CAACC,OAAO,EAAEU,KAAK,EAAE;IACxB,IAAIA,KAAK,KAAKF,SAAS,EAAE;MACrB,KAAK,CAAC,GAAGR,OAAO,KAAKU,KAAK,EAAE,CAAC;MAC7B,IAAI,CAACA,KAAK,GAAGA,KAAK;IACt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,OAAO,EAAE;IACjB,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,aAAa;EAC7B;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]} |