8000 bug #38358 [Messenger] Fix redis connection error message (alexander-… · lucasaba/symfony@8731a4f · GitHub
[go: up one dir, main page]

Skip to content

Commit 8731a4f

Browse files
bug symfony#38358 [Messenger] Fix redis connection error message (alexander-schranz)
This PR was submitted for the 4.3 branch but it was merged into the 4.4 branch instead. Discussion ---------- [Messenger] Fix redis connection error message Use correct instance of redis to getLastError | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #... | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> The `$redis` is on FC1E ly set in the tests, the correct redis instance is available under `$this->connection`. Reproduce: give a false `AUTH` to the redis: Before: > [Error] > Call to a member function getLastError() on null Now: > [Symfony\Component\Messenger\Exception\InvalidArgumentException] > Redis connection failed: ERR Client sent AUTH, but no password is set Commits ------- f4e42ad Fix redis connection error message
2 parents c4015ed + f4e42ad commit 8731a4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Messenger/Transport/RedisExt/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ public function __construct(array $configuration, array $connectionCredentials =
6161
}
6262

6363
if (null !== $auth && !$this->connection->auth($auth)) {
64-
throw new InvalidArgumentException('Redis connection failed: '.$redis->getLastError());
64+
throw new InvalidArgumentException('Redis connection failed: '.$this->connection->getLastError());
6565
}
6666

6767
if (($dbIndex = $configuration['dbindex'] ?? self::DEFAULT_OPTIONS['dbindex']) && !$this->connection->select($dbIndex)) {
68-
throw new InvalidArgumentException('Redis connection failed: '.$redis->getLastError());
68+
throw new InvalidArgumentException('Redis connection failed: '.$this->connection->getLastError());
6969
}
7070

7171
foreach (['stream', 'group', 'consumer'] as $key) {

0 commit comments

Comments
 (0)
0