onCommandFailure method
Called when command processing fails Override to handle command failures
Implementation
@override
Future<void> onCommandFailure(Command command, dynamic error) async {
await super.onCommandFailure(command, error);
// Send error response to sender if running in actor system
final sender = _capturedSenders[command.commandId];
if (sender != null) {
sender.tell(ChannelCommandResult.failed(
commandId: command.commandId,
error: error.toString(),
));
_capturedSenders.remove(command.commandId);
}
}