{"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\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\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 }\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;\n"],"mappings":"AAAA,YAAY;;AACZA,MAA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AO,EAAE;IACjB,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,sBAAsB;EACtC;AACJ;AACAhB,OAAO,CAACI,oBAAoB,GAAGA,oBAAoB;AACnD;AACA,MAAMD,aAAa,SAASS,WAAW,CAAC;EACpC;EACAE,WAAWA,CAACC,OAAO,EAAE;IACjB,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,eAAe;EAC/B;AACJ;AACAhB,OAAO,CAACG,aAAa,GAAGA,aAAa;AACrC;AACA,MAAMD,WAAW,SAASU,WAAW,CAAC;EAClC;EACAE,WAAWA,CAACC,OAAO,EAAE;IACjB,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,aAAa;EAC7B;AACJ;AACAhB,OAAO,CAACE,WAAW,GAAGA,WAAW","ignoreList":[]},"metadata":{},"sourceType":"script","externalDependencies":[]}