useCommandError — component-scoped error boundary for command failures.
Subscribes to the bus and captures all failed command results reactively. Optional filter narrows which actions are tracked.
const { latestError, errors, clearErrors } = useCommandError()// Only watch cart commandsconst { latestError } = useCommandError({ filter: cmd => cmd.action.startsWith('cart') }) Copy
const { latestError, errors, clearErrors } = useCommandError()// Only watch cart commandsconst { latestError } = useCommandError({ filter: cmd => cmd.action.startsWith('cart') })
useCommandError — component-scoped error boundary for command failures.
Subscribes to the bus and captures all failed command results reactively. Optional filter narrows which actions are tracked.