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

1 line
10 KiB
JSON
Raw Normal View History

2024-09-17 20:35:18 -04:00
{"ast":null,"code":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.MisuseError = exports.InternalError = exports.ProtocolVersionError = exports.LibsqlUrlParseError = exports.HttpServerError = exports.WebSocketError = exports.WebSocketUnsupportedError = exports.ClosedError = exports.ResponseError = exports.ProtoError = exports.ClientError = void 0;\n/** Generic error produced by the Hrana client. */\nclass ClientError extends Error {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"ClientError\";\n }\n}\nexports.ClientError = ClientError;\n/** Error thrown when the server violates the protocol. */\nclass ProtoError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"ProtoError\";\n }\n}\nexports.ProtoError = ProtoError;\n/** Error thrown when the server returns an error response. */\nclass 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}\nexports.ResponseError = ResponseError;\n/** Error thrown when the client or stream is closed. */\nclass 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}\nexports.ClosedError = ClosedError;\n/** Error thrown when the environment does not seem to support WebSockets. */\nclass WebSocketUnsupportedError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"WebSocketUnsupportedError\";\n }\n}\nexports.WebSocketUnsupportedError = WebSocketUnsupportedError;\n/** Error thrown when we encounter a WebSocket error. */\nclass WebSocketError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"WebSocketError\";\n }\n}\nexports.WebSocketError = WebSocketError;\n/** Error thrown when the HTTP server returns an error response. */\nclass HttpServerError extends ClientError {\n status;\n /** @private */\n constructor(message, status) {\n super(message);\n this.status = status;\n this.name = \"HttpServerError\";\n }\n}\nexports.HttpServerError = HttpServerError;\n/** Error thrown when a libsql URL is not valid. */\nclass LibsqlUrlParseError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"LibsqlUrlParseError\";\n }\n}\nexports.LibsqlUrlParseError = LibsqlUrlParseError;\n/** Error thrown when the protocol version is too low to support a feature. */\nclass ProtocolVersionError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"ProtocolVersionError\";\n }\n}\nexports.ProtocolVersionError = ProtocolVersionError;\n/** Error thrown when an internal client error happens. */\nclass InternalError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"InternalError\";\n }\n}\nexports.InternalError = InternalError;\n/** Error thrown when the API is misused. */\nclass MisuseError extends ClientError {\n /** @private */\n constructor(message) {\n super(message);\n this.name = \"MisuseError\";\n }\n}\nexports.MisuseError = MisuseError;","map":{"version":3,"names":["Object","defineProperty","exports","value","MisuseError","InternalError","ProtocolVersionError","LibsqlUrlParseError","HttpServerError","WebSocketError","WebSocketUnsupportedError","ClosedError","ResponseError","ProtoError","ClientError","Error","constructor","message","name","code","proto","protoError","stack","undefined","cause","status"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/@libsql/hrana-client/lib-cjs/errors.js"],"sourcesContent":["\"use strict\