ErrorBoundaryNode class
Catches exceptions during subtree rendering or reactive rebuilds and renders fallback instead of crashing.
DOM Mounting and Sentinels
In the browser, ErrorBoundaryNode mounts between sentinel comments:
<!-- bloom:error-boundary --> and <!-- /bloom:error-boundary -->.
Installs an ambient error boundary handler in the Zone. If builder throws during initial mount, or if an unhandled error occurs during a nested reactive update or SuspenseNode failure, the error is caught, the failed subtree's resources are disposed, and fallback is mounted in place between the sentinels. If fallback itself throws, the error bubbles up to the next enclosing error boundary.
SSR Behavior
In SSR (renderToHtml), executes builder inside a try/catch. If an exception
is thrown, renders fallback(err, stack).
Usually created using the DSL sugar ErrorBoundary.
Constructors
- ErrorBoundaryNode({required BloomNode builder(), required BloomNode fallback(Object error, StackTrace stackTrace)})
-
Creates an error boundary descriptor with
builderand errorfallback.const
Properties
- builder → BloomNode Function()
-
Factory building the primary subtree.
final
- fallback → BloomNode Function(Object error, StackTrace stackTrace)
-
Fallback builder invoked with the caught Object error and StackTrace when builder fails.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited