Comparing version 0.12.0 to 0.13.0-beta.0
@@ -130,3 +130,3 @@ "use strict"; | ||
catch (err) { | ||
console.error('error: ', err); | ||
console.error(serializeErrorAsJson(err)); | ||
if (err.response === undefined) { | ||
@@ -168,3 +168,3 @@ throw new Error(`Network Error: ${err.message}`); | ||
catch (err) { | ||
console.error('error: ', err); | ||
console.error(serializeErrorAsJson(err)); | ||
if (err.response === undefined) { | ||
@@ -204,2 +204,11 @@ throw new Error(`Network Error: ${err.message}`); | ||
exports.HttpLancedbClient = HttpLancedbClient; | ||
function serializeErrorAsJson(err) { | ||
const error = JSON.parse(JSON.stringify(err, Object.getOwnPropertyNames(err))); | ||
error.response = err.response != null | ||
? JSON.parse(JSON.stringify(err.response, | ||
// config contains the request data, too noisy | ||
Object.getOwnPropertyNames(err.response).filter(prop => prop !== 'config'))) | ||
: null; | ||
return JSON.stringify({ error }); | ||
} | ||
//# sourceMappingURL=client.js.map |
{ | ||
"name": "vectordb", | ||
"version": "0.12.0", | ||
"version": "0.13.0-beta.0", | ||
"description": " Serverless, low-latency vector database for AI applications", | ||
@@ -91,8 +91,8 @@ "main": "dist/index.js", | ||
"optionalDependencies": { | ||
"@lancedb/vectordb-darwin-arm64": "0.12.0", | ||
"@lancedb/vectordb-darwin-x64": "0.12.0", | ||
"@lancedb/vectordb-linux-arm64-gnu": "0.12.0", | ||
"@lancedb/vectordb-linux-x64-gnu": "0.12.0", | ||
"@lancedb/vectordb-win32-x64-msvc": "0.12.0" | ||
"@lancedb/vectordb-darwin-arm64": "0.13.0-beta.0", | ||
"@lancedb/vectordb-darwin-x64": "0.13.0-beta.0", | ||
"@lancedb/vectordb-linux-arm64-gnu": "0.13.0-beta.0", | ||
"@lancedb/vectordb-linux-x64-gnu": "0.13.0-beta.0", | ||
"@lancedb/vectordb-win32-x64-msvc": "0.13.0-beta.0" | ||
} | ||
} |
@@ -15,3 +15,3 @@ // Copyright 2023 LanceDB Developers. | ||
import axios, { type AxiosResponse, type ResponseType } from 'axios' | ||
import axios, { type AxiosError, type AxiosResponse, type ResponseType } from 'axios' | ||
@@ -201,3 +201,3 @@ import { tableFromIPC, type Table as ArrowTable } from 'apache-arrow' | ||
} catch (err: any) { | ||
console.error('error: ', err) | ||
console.error(serializeErrorAsJson(err)) | ||
if (err.response === undefined) { | ||
@@ -252,3 +252,4 @@ throw new Error(`Network Error: ${err.message as string}`) | ||
} catch (err: any) { | ||
console.error('error: ', err) | ||
console.error(serializeErrorAsJson(err)) | ||
if (err.response === undefined) { | ||
@@ -293,1 +294,13 @@ throw new Error(`Network Error: ${err.message as string}`) | ||
} | ||
function serializeErrorAsJson(err: AxiosError) { | ||
const error = JSON.parse(JSON.stringify(err, Object.getOwnPropertyNames(err))) | ||
error.response = err.response != null | ||
? JSON.parse(JSON.stringify( | ||
err.response, | ||
// config contains the request data, too noisy | ||
Object.getOwnPropertyNames(err.response).filter(prop => prop !== 'config') | ||
)) | ||
: null | ||
return JSON.stringify({ error }) | ||
} |
Sorry, the diff of this file is not supported yet
540682
10671