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