$ rezi
Widgets

ErrorBoundary

Protects a risky widget subtree so runtime exceptions do not fault the whole app.

Protects a risky widget subtree so runtime exceptions do not fault the whole app.

Usage

ui.errorBoundary({
  children: RiskyWidget(),
  fallback: (error) =>
    ui.errorDisplay(error.message, {
      title: "Widget failed",
      onRetry: error.retry,
    }),
})

Props

PropTypeDefaultDescription
childrenVNoderequiredProtected subtree
fallback(error: ErrorBoundaryError) => VNoderequiredFallback renderer when subtree throws
keystring-Reconciliation key

Fallback Error Payload

FieldTypeDescription
code"ZRUI_USER_CODE_THROW"Runtime error code for trapped subtree throw
messagestringDisplay-friendly message
detailstringFull runtime detail string
stackstring | undefinedOptional stack trace
retry() => voidRetries only this boundary subtree on the next commit

Behavior

  • The boundary stays in fallback mode across normal app updates until error.retry() is called.
  • Retry marks only the boundary subtree dirty and re-attempts rendering it.
  • If fallback code itself throws or returns an invalid value, the runtime treats it as a normal user-code failure.

On this page