@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.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
- throw new Error(`Retrieve failed: ${JSON.stringify(error)}`);
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
  }