libsql-stateless
Advanced tools
Comparing version 2.6.0 to 2.7.0
@@ -11,3 +11,4 @@ "use strict"; | ||
}); | ||
if (res.ok) | ||
if (res.ok && | ||
res.headers.get("content-type") === "application/json") | ||
return { isOk: true, val: await res.json() }; | ||
@@ -17,7 +18,11 @@ else | ||
kind: "LIBSQL_SERVER_ERROR", | ||
error_data: { | ||
server_message: await res.text(), | ||
http_status_code: res.status, | ||
http_status_text: res.statusText | ||
} | ||
server_message: await (async () => { | ||
try { | ||
return await res.text(); | ||
} | ||
catch { | ||
return null; | ||
} | ||
})(), | ||
http_status_code: res.status | ||
} }; | ||
@@ -52,3 +57,3 @@ } | ||
kind: "LIBSQL_RESPONSE_ERROR", | ||
error_data: resu.error //has to be StreamResErr | ||
data: resu.error //has to be StreamResErr | ||
} }; | ||
@@ -87,3 +92,3 @@ } | ||
kind: "LIBSQL_RESPONSE_ERROR", | ||
error_data: resu.error //has to be StreamResErr | ||
data: resu.error //has to be StreamResErr | ||
} }; | ||
@@ -90,0 +95,0 @@ } |
@@ -8,3 +8,4 @@ async function hranaFetch(s) { | ||
}); | ||
if (res.ok) | ||
if (res.ok && | ||
res.headers.get("content-type") === "application/json") | ||
return { isOk: true, val: await res.json() }; | ||
@@ -14,7 +15,11 @@ else | ||
kind: "LIBSQL_SERVER_ERROR", | ||
error_data: { | ||
server_message: await res.text(), | ||
http_status_code: res.status, | ||
http_status_text: res.statusText | ||
} | ||
server_message: await (async () => { | ||
try { | ||
return await res.text(); | ||
} | ||
catch { | ||
return null; | ||
} | ||
})(), | ||
http_status_code: res.status | ||
} }; | ||
@@ -49,3 +54,3 @@ } | ||
kind: "LIBSQL_RESPONSE_ERROR", | ||
error_data: resu.error //has to be StreamResErr | ||
data: resu.error //has to be StreamResErr | ||
} }; | ||
@@ -83,3 +88,3 @@ } | ||
kind: "LIBSQL_RESPONSE_ERROR", | ||
error_data: resu.error //has to be StreamResErr | ||
data: resu.error //has to be StreamResErr | ||
} }; | ||
@@ -86,0 +91,0 @@ } |
@@ -14,10 +14,7 @@ export type libsqlResult<T, E> = { | ||
kind: "LIBSQL_SERVER_ERROR"; | ||
error_data: { | ||
server_message: string; | ||
http_status_code: number; | ||
http_status_text: string; | ||
}; | ||
server_message: string | null; | ||
http_status_code: number; | ||
} | { | ||
kind: "LIBSQL_RESPONSE_ERROR"; | ||
error_data: libsqlStreamResErrData; | ||
data: libsqlStreamResErrData; | ||
}; | ||
@@ -24,0 +21,0 @@ export type libsqlPipelineReq = { |
{ | ||
"name": "libsql-stateless", | ||
"version": "2.6.0", | ||
"version": "2.7.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
17524
384