Skip to content

Commit

Permalink
Remove full DSNs from exception messages
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Nov 3, 2023
1 parent 24e5cc9 commit 8ba6a2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Tests/Transport/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ConnectionTest extends TestCase
public function testItCannotBeConstructedWithAWrongDsn()
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('The given AMQP DSN "amqp://:" is invalid.');
$this->expectExceptionMessage('The given AMQP DSN is invalid.');
Connection::fromDsn('amqp://:');
}

Expand Down
2 changes: 1 addition & 1 deletion Transport/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public static function fromDsn(string $dsn, array $options = [], AmqpFactory $am
if (false === $parsedUrl = parse_url($dsn)) {
// this is a valid URI that parse_url cannot handle when you want to pass all parameters as options
if (!\in_array($dsn, ['amqp://', 'amqps://'])) {
throw new InvalidArgumentException(sprintf('The given AMQP DSN "%s" is invalid.', $dsn));
throw new InvalidArgumentException('The given AMQP DSN is invalid.');
}

$parsedUrl = [];
Expand Down

0 comments on commit 8ba6a2c

Please sign in to comment.