@arbidocs/sdk 0.3.50 → 0.3.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +11 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +11 -1
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -5211,7 +5211,17 @@ async function retrieve(options) {
|
|
|
5211
5211
|
};
|
|
5212
5212
|
const { data, error } = await arbi.fetch.POST("/v1/assistant/retrieve", { body });
|
|
5213
5213
|
if (error) {
|
|
5214
|
-
|
|
5214
|
+
const detail = error?.detail;
|
|
5215
|
+
let message;
|
|
5216
|
+
if (typeof detail === "string") {
|
|
5217
|
+
message = detail;
|
|
5218
|
+
} else if (detail && typeof detail === "object") {
|
|
5219
|
+
const d2 = detail;
|
|
5220
|
+
message = typeof d2.hint === "string" && d2.hint || JSON.stringify(detail);
|
|
5221
|
+
} else {
|
|
5222
|
+
message = JSON.stringify(error);
|
|
5223
|
+
}
|
|
5224
|
+
throw new Error(`Retrieve failed: ${message}`);
|
|
5215
5225
|
}
|
|
5216
5226
|
return data;
|
|
5217
5227
|
}
|