diff --git a/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php b/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php index 6d1c57b6f248d..f1875a8b49101 100644 --- a/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php +++ b/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php @@ -199,10 +199,14 @@ public function channel(): \AMQPChannel $connection = $this->amqpFactory->createConnection($this->connectionCredentials); $connectMethod = 'true' === ($this->connectionCredentials['persistent'] ?? 'false') ? 'pconnect' : 'connect'; - if (false === $connection->{$connectMethod}()) { - throw new \AMQPException('Could not connect to the AMQP server. Please verify the provided DSN.'); - } + try { + $connection->{$connectMethod}(); + } catch (\AMQPConnectionException $e) { + $credentials = $this->connectionCredentials; + $credentials['password'] = '********'; + throw new \AMQPException(sprintf('Could not connect to the AMQP server. Please verify the provided DSN. (%s)', json_encode($credentials)), 0, $e); + } $this->amqpChannel = $this->amqpFactory->createChannel($connection); }
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: