Table of Contents

Property OnCaughtError

Namespace
Velvet
Assembly
Velvet.Docs.dll

OnCaughtError

Called when an error boundary in this tree catches an error — React's onCaughtError. It is called in the commit that shows the boundary's fallback, after the fallback's layout effects and before those of the boundary's ancestors; a boundary that an ancestor boundary replaces before that commit reports nothing. A boundary that a time-sliced transition mounted or re-rendered, catching before the transition completes, reports in the commit that completes it, after its own layout effects. It receives the caught exception and an ErrorInfo naming the boundary and carrying the component stack. When null, the error is logged with Debug.LogException, together with the boundary's name and the component stack. An exception the handler throws is logged and does not reach the tree.

public Action<Exception, ErrorInfo>? OnCaughtError { get; init; }

Property Value

Action<Exception, ErrorInfo>