@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/browser.cjs
CHANGED
|
@@ -4687,7 +4687,17 @@ async function retrieve(options) {
|
|
|
4687
4687
|
};
|
|
4688
4688
|
const { data, error } = await arbi.fetch.POST("/v1/assistant/retrieve", { body });
|
|
4689
4689
|
if (error) {
|
|
4690
|
-
|
|
4690
|
+
const detail = error?.detail;
|
|
4691
|
+
let message;
|
|
4692
|
+
if (typeof detail === "string") {
|
|
4693
|
+
message = detail;
|
|
4694
|
+
} else if (detail && typeof detail === "object") {
|
|
4695
|
+
const d2 = detail;
|
|
4696
|
+
message = typeof d2.hint === "string" && d2.hint || JSON.stringify(detail);
|
|
4697
|
+
} else {
|
|
4698
|
+
message = JSON.stringify(error);
|
|
4699
|
+
}
|
|
4700
|
+
throw new Error(`Retrieve failed: ${message}`);
|
|
4691
4701
|
}
|
|
4692
4702
|
return data;
|
|
4693
4703
|
}
|