Skip to content

Commit

Permalink
Fix redis connection error message
Browse files Browse the repository at this point in the history
Use correct instance of redis to getLastError
  • Loading branch information
alexander-schranz authored and nicolas-grekas committed Sep 30, 2020
1 parent a363b9c commit e76350e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Transport/RedisExt/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ public function __construct(array $configuration, array $connectionCredentials =
}

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

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

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

0 comments on commit e76350e

Please sign in to comment.