diff --git a/src/Console/Command/AbstractConsumerCommand.php b/src/Console/Command/AbstractConsumerCommand.php index 4d96d4b..2ed04f5 100644 --- a/src/Console/Command/AbstractConsumerCommand.php +++ b/src/Console/Command/AbstractConsumerCommand.php @@ -35,8 +35,8 @@ protected function validateConsumerName(string $consumerName): void } catch (ConsumerFactoryException $e) { throw new \InvalidArgumentException( - sprintf( - "Consumer [$consumerName] does not exist. \n\n Available consumers: %s", + $e->getMessage() . sprintf( + "\n\n Available consumers: %s", implode('', array_map(static function($s): string { return "\n\t- [{$s}]"; }, $this->consumersDataBag->getDataKeys()))