Skip to content

Commit

Permalink
refactor(sanity): remove throw errors
Browse files Browse the repository at this point in the history
  • Loading branch information
RitaDias committed Sep 30, 2024
1 parent dfb2dd0 commit 37eb0bb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -44,7 +44,6 @@ export function ValidationInspector(props: DocumentInspectorProps) {
[onFocus, onPathOpen],
)

throw new Error('This is an error from the validation inspector')
return (
<Flex direction="column" height="fill" overflow="hidden">
<DocumentInspectorHeader
Expand Down

0 comments on commit 37eb0bb

Please sign in to comment.