libsql-stateless
Advanced tools
Comparing version 2.5.10 to 2.6.0
@@ -15,12 +15,5 @@ "use strict"; | ||
return { isOk: false, err: { | ||
kind: "libsqlPipelineResErr", | ||
kind: "LIBSQL_SERVER_ERROR", | ||
error_data: { | ||
server_message: await (async () => { | ||
try { | ||
return await res.clone().json(); | ||
} | ||
catch { | ||
return await res.text(); | ||
} | ||
})(), | ||
server_message: await res.text(), | ||
http_status_code: res.status, | ||
@@ -57,8 +50,8 @@ http_status_text: res.statusText | ||
return { isOk: false, err: { | ||
kind: "libsqlStreamResErrData", | ||
error_data: resu.error | ||
} }; //has to be StreamResErr | ||
kind: "LIBSQL_RESPONSE_ERROR", | ||
error_data: resu.error //has to be StreamResErr | ||
} }; | ||
} | ||
else | ||
return res; //PipelineResErr or StreamResErrData | ||
return res; //whatever server error returned | ||
} | ||
@@ -92,8 +85,8 @@ exports.libsqlExecute = libsqlExecute; | ||
return { isOk: false, err: { | ||
kind: "libsqlStreamResErrData", | ||
error_data: resu.error | ||
} }; //has to be StreamResErr | ||
kind: "LIBSQL_RESPONSE_ERROR", | ||
error_data: resu.error //has to be StreamResErr | ||
} }; | ||
} | ||
else | ||
return res; //PipelineResErr or StreamResErrData | ||
return res; //whatever server error returned | ||
} | ||
@@ -100,0 +93,0 @@ exports.libsqlBatch = libsqlBatch; |
@@ -12,12 +12,5 @@ async function hranaFetch(s) { | ||
return { isOk: false, err: { | ||
kind: "libsqlPipelineResErr", | ||
kind: "LIBSQL_SERVER_ERROR", | ||
error_data: { | ||
server_message: await (async () => { | ||
try { | ||
return await res.clone().json(); | ||
} | ||
catch { | ||
return await res.text(); | ||
} | ||
})(), | ||
server_message: await res.text(), | ||
http_status_code: res.status, | ||
@@ -54,8 +47,8 @@ http_status_text: res.statusText | ||
return { isOk: false, err: { | ||
kind: "libsqlStreamResErrData", | ||
error_data: resu.error | ||
} }; //has to be StreamResErr | ||
kind: "LIBSQL_RESPONSE_ERROR", | ||
error_data: resu.error //has to be StreamResErr | ||
} }; | ||
} | ||
else | ||
return res; //PipelineResErr or StreamResErrData | ||
return res; //whatever server error returned | ||
} | ||
@@ -88,8 +81,8 @@ /** | ||
return { isOk: false, err: { | ||
kind: "libsqlStreamResErrData", | ||
error_data: resu.error | ||
} }; //has to be StreamResErr | ||
kind: "LIBSQL_RESPONSE_ERROR", | ||
error_data: resu.error //has to be StreamResErr | ||
} }; | ||
} | ||
else | ||
return res; //PipelineResErr or StreamResErrData | ||
return res; //whatever server error returned | ||
} | ||
@@ -96,0 +89,0 @@ /** |
@@ -13,8 +13,11 @@ export type libsqlResult<T, E> = { | ||
export type libsqlError = { | ||
kind: "libsqlPipelineResErr" | "libsqlStreamResErrData"; | ||
error_data: libsqlStreamResErrData | { | ||
server_message: libsqlPipelineResErr; | ||
kind: "LIBSQL_SERVER_ERROR"; | ||
error_data: { | ||
server_message: string; | ||
http_status_code: number; | ||
http_status_text: string; | ||
}; | ||
} | { | ||
kind: "LIBSQL_RESPONSE_ERROR"; | ||
error_data: libsqlStreamResErrData; | ||
}; | ||
@@ -25,3 +28,3 @@ export type libsqlPipelineReq = { | ||
}; | ||
export type libsqlPipelineResOk = { | ||
export type libsqlPipelineRes = { | ||
baton: string | null; | ||
@@ -31,5 +34,2 @@ base_url: string | null; | ||
}; | ||
export type libsqlPipelineResErr = string | { | ||
error: string; | ||
}; | ||
export type libsqlCloseStreamReq = { | ||
@@ -36,0 +36,0 @@ type: "close"; |
{ | ||
"name": "libsql-stateless", | ||
"version": "2.5.10", | ||
"version": "2.6.0", | ||
"homepage": "https://github.com/DaBigBlob/libsql-stateless#readme", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17284
377