sanity 6.3.0-next.45 → 6.3.0-next.47

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.
@@ -2508,7 +2508,8 @@ declare const studioLocaleStrings: {
2508
2508
  'asset-source.dialog.button.select': string;
2509
2509
  /** Keys shared between both image asset source and file asset source */
2510
2510
  /** Insert asset error */
2511
- 'asset-source.dialog.insert-asset-error': string; /** Select asset dialog load more items */
2511
+ 'asset-source.dialog.insert-asset-error': string; /** Toast title shown when the list of assets failed to load */
2512
+ 'asset-source.dialog.load-error': string; /** Select asset dialog load more items */
2512
2513
  'asset-source.dialog.load-more': string;
2513
2514
  /** Text shown when selecting a file but there's no files to select from
2514
2515
  * @deprecated no longer in use
@@ -644,11 +644,19 @@ class DividerBuilder {
644
644
  }
645
645
  }
646
646
  async function resolveTypeForDocument(getClient, id) {
647
- return await getClient(DEFAULT_STUDIO_CLIENT_OPTIONS).fetch("*[sanity::versionOf($publishedId)][0]._type", {
648
- publishedId: getPublishedId(id)
649
- }, {
650
- tag: "structure.resolve-type"
651
- });
647
+ const query = "*[sanity::versionOf($publishedId)][0]._type";
648
+ try {
649
+ return await getClient(DEFAULT_STUDIO_CLIENT_OPTIONS).fetch(query, {
650
+ publishedId: getPublishedId(id)
651
+ }, {
652
+ tag: "structure.resolve-type"
653
+ }) ?? void 0;
654
+ } catch (err) {
655
+ console.error(new Error(`Failed to resolve document type for "${id}"`, {
656
+ cause: err
657
+ }));
658
+ return;
659
+ }
652
660
  }
653
661
  class GenericViewBuilder {
654
662
  /** Generic view option object */