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