From 37eb0bb2b90f71c243978f47e4e4e728e520758f Mon Sep 17 00:00:00 2001 From: Rita Date: Mon, 30 Sep 2024 13:40:51 +0200 Subject: [PATCH] refactor(sanity): remove throw errors --- .../src/structure/components/structureTool/StructureTitle.tsx | 1 - .../document/inspectors/validation/ValidationInspector.tsx | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/sanity/src/structure/components/structureTool/StructureTitle.tsx b/packages/sanity/src/structure/components/structureTool/StructureTitle.tsx index 3bd2b940702..426f684e448 100644 --- a/packages/sanity/src/structure/components/structureTool/StructureTitle.tsx +++ b/packages/sanity/src/structure/components/structureTool/StructureTitle.tsx @@ -46,7 +46,6 @@ const DocumentTitle = (props: {documentId: string; documentType: string}) => { document.title = newTitle }, [documentTitle, settled, newTitle]) - throw new Error('This is an error from the structure tool') return null } diff --git a/packages/sanity/src/structure/panes/document/inspectors/validation/ValidationInspector.tsx b/packages/sanity/src/structure/panes/document/inspectors/validation/ValidationInspector.tsx index 419ad16cbec..b3d7c94e582 100644 --- a/packages/sanity/src/structure/panes/document/inspectors/validation/ValidationInspector.tsx +++ b/packages/sanity/src/structure/panes/document/inspectors/validation/ValidationInspector.tsx @@ -13,7 +13,7 @@ import { } from '@sanity/types' import {Box, Card, type CardTone, ErrorBoundary, Flex, Stack, Text} from '@sanity/ui' import {createElement, type ErrorInfo, Fragment, useCallback, useMemo, useState} from 'react' -import {type DocumentInspectorProps, useSource, useTranslation} from 'sanity' +import {type DocumentInspectorProps, useTranslation} from 'sanity' import {DocumentInspectorHeader} from '../../documentInspector' import {useDocumentPane} from '../../useDocumentPane' @@ -44,7 +44,6 @@ export function ValidationInspector(props: DocumentInspectorProps) { [onFocus, onPathOpen], ) - throw new Error('This is an error from the validation inspector') return (