Error boundary

The error boundary component repurposes the <ErrorState> component for an application error boundary.

Examples

Error boundary usage example

A basic error boundary appears when an error is thrown inside of the wrapped content.

The component itself has a headerTitle, an errorTitle, and shows an en error stack with details.

Demo content wrapped in error boundary

This is a demo content that may throw an error:

Props

ErrorBoundary

*required
NameTypeDefaultDescription
childrenReact.ReactNodeThe component that the error boundary component is wrapped around, which should be returned if there is no error
defaultErrorDescriptionReact.ReactNodeThe default description text to display with the error if no errorDescription is provided
errorDescriptionReact.ReactNodeThe description text to display with the error
errorTitlestringThe title text to display with the error
errorTitleHeadingLevel'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'"h2"The heading level to use on the error title, default is h2
errorToggleTextstringThe text for the toggle link that users can select to view error details
headerTitlestringThe title text to display on the error page
headerTitleHeadingLevel'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'"h1"The heading level to use on the header title, default is h1
ouiaIdstring | numberCustom OUIA ID
silentbooleanIndicates if the error is silent