diff --git a/src/CommandBusClient.php b/src/CommandBusClient.php index c8d3c98..880f8de 100644 --- a/src/CommandBusClient.php +++ b/src/CommandBusClient.php @@ -143,8 +143,8 @@ class CommandBusClient implements CommandBusInterface public function execute(string $command, array $context): PromiseInterface { if (!$this->connection) { - return new Promise(function (callable $resolve) { - $resolve(new \RuntimeException("Not connected to command bus.")); + return new Promise(function (callable $resolve, callable $canceller) { + $canceller("Not connected to command bus."); }); }