callbacks.onError event fires when the widget encounters an error at runtime — a failed API call, a failed transaction, a wallet error, and so on.
This callback reports errors inside a loaded, running widget. Failures to load the widget itself (network, manifest, signature issues) surface through the top-level
onError prop instead — see Widget delivery and security.Callback Argument Value
The payload is a discriminated union — switch onerror.type to handle specific categories. Every variant carries the base error fields:
type values and their extra fields:
Example of handling some categories: