the-forest/client/node_modules/.cache/babel-loader/f2ff8b8535a204fdc1824581a1d490bc6cbc0037f285897f01b663ca02ab1682.json

1 line
8.1 KiB
JSON
Raw Normal View History

2024-09-17 20:35:18 -04:00
{"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 }