Function: attachRenderErrorHandler()
API / @xmachines/play-actor / attachRenderErrorHandler
function attachRenderErrorHandler<TRegistry>(registry, handler): TRegistry;Defined in: packages/play-actor/src/provider-guards.ts:64
Clone a component registry and inject an onRenderError handler.
The handler is defined as a non-enumerable, configurable own property on the
clone (per D-19 — one injection convention for all framework renderers), so
it overrides any handler set at defineRegistry level without showing up
when the registry’s component entries are enumerated.
The caller’s registry is never mutated — a shallow clone is returned. Callers
that need per-instance handlers (e.g. an onRenderError prop on
ActorProvider) can therefore share one defineRegistry result across
providers safely.
Type Parameters
| Type Parameter | Description |
|---|---|
TRegistry extends object | The framework-specific component registry type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
registry | TRegistry | The component registry from defineRegistry().registry. |
handler | RenderErrorHandler | Called with (error, componentName) when a catalog component throws during render. |
Returns
TRegistry
A shallow clone of registry with onRenderError attached.