libsql-stateless-easy
Advanced tools
Comparing version
@@ -18,3 +18,3 @@ "use strict"; | ||
return { type: "blob", base64: js_base64_1.Base64.fromUint8Array(value) }; | ||
throw new errors_1.MisuseError("Invalid type of input. Cannot build request to server."); | ||
throw new errors_1.InternalError("Invalid type of input. Cannot build request to server."); | ||
} | ||
@@ -21,0 +21,0 @@ exports.libsqlValueBuilder = libsqlValueBuilder; |
@@ -15,5 +15,5 @@ "use strict"; | ||
if (res.err.kind === "LIBSQL_SERVER_ERROR") | ||
throw new errors_1.HttpServerError(res.err.error_data.server_message, res.err.error_data.http_status_code); | ||
throw new errors_1.HttpServerError(res.err.server_message || "Server encountered error.", res.err.http_status_code); | ||
else | ||
throw new errors_1.ResponseError(res.err.error_data.message, res.err.error_data); | ||
throw new errors_1.ResponseError(res.err.data.message, res.err.data); | ||
} | ||
@@ -36,5 +36,5 @@ } | ||
if (res.err.kind === "LIBSQL_SERVER_ERROR") | ||
throw new errors_1.HttpServerError(res.err.error_data.server_message, res.err.error_data.http_status_code); | ||
throw new errors_1.HttpServerError(res.err.server_message || "Server encountered error.", res.err.http_status_code); | ||
else | ||
throw new errors_1.ResponseError(res.err.error_data.message, res.err.error_data); | ||
throw new errors_1.ResponseError(res.err.data.message, res.err.data); | ||
} | ||
@@ -41,0 +41,0 @@ } |
@@ -71,3 +71,3 @@ "use strict"; | ||
else | ||
throw new errors_1.ResponseError("An SQL statements in batch.", res.step_errors[j]); | ||
throw new errors_1.ResponseError(res.step_errors[j]?.message, res.step_errors[j]); | ||
} | ||
@@ -74,0 +74,0 @@ return batchResults; |
import { Base64 } from 'js-base64'; | ||
import { MisuseError } from './errors'; | ||
import { InternalError } from './errors'; | ||
//======================================================== | ||
@@ -15,3 +15,3 @@ export function libsqlValueBuilder(value) { | ||
return { type: "blob", base64: Base64.fromUint8Array(value) }; | ||
throw new MisuseError("Invalid type of input. Cannot build request to server."); | ||
throw new InternalError("Invalid type of input. Cannot build request to server."); | ||
} | ||
@@ -18,0 +18,0 @@ //======================================================== |
@@ -12,5 +12,5 @@ import { libsqlExecute as LIBlibsqlExecute, libsqlBatch as LIBlibsqlBatch, libsqlServerCompatCheck as LIBlibsqlServerCompatCheck } from "libsql-stateless"; | ||
if (res.err.kind === "LIBSQL_SERVER_ERROR") | ||
throw new HttpServerError(res.err.error_data.server_message, res.err.error_data.http_status_code); | ||
throw new HttpServerError(res.err.server_message || "Server encountered error.", res.err.http_status_code); | ||
else | ||
throw new ResponseError(res.err.error_data.message, res.err.error_data); | ||
throw new ResponseError(res.err.data.message, res.err.data); | ||
} | ||
@@ -32,5 +32,5 @@ } | ||
if (res.err.kind === "LIBSQL_SERVER_ERROR") | ||
throw new HttpServerError(res.err.error_data.server_message, res.err.error_data.http_status_code); | ||
throw new HttpServerError(res.err.server_message || "Server encountered error.", res.err.http_status_code); | ||
else | ||
throw new ResponseError(res.err.error_data.message, res.err.error_data); | ||
throw new ResponseError(res.err.data.message, res.err.data); | ||
} | ||
@@ -37,0 +37,0 @@ } |
@@ -66,5 +66,5 @@ import { Base64 } from "js-base64"; | ||
else | ||
throw new ResponseError("An SQL statements in batch.", res.step_errors[j]); | ||
throw new ResponseError(res.step_errors[j]?.message, res.step_errors[j]); | ||
} | ||
return batchResults; | ||
} |
{ | ||
"name": "libsql-stateless-easy", | ||
"version": "1.3.5", | ||
"version": "1.3.6", | ||
"homepage": "https://github.com/DaBigBlob/libsql-stateless-easy#readme", | ||
@@ -67,4 +67,4 @@ "repository": { | ||
"js-base64": "^3.7.5", | ||
"libsql-stateless": "^2.6.0" | ||
"libsql-stateless": "^2.7.0" | ||
} | ||
} |
33049
-0.03%Updated