Skip to content

Commit 1d28b2a

Browse files
committed
Update RedisDashboard.php
1 parent 9f1b2f2 commit 1d28b2a

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/Dashboards/Redis/RedisDashboard.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
namespace RobiNN\Pca\Dashboards\Redis;
1414

15-
use Exception;
1615
use Redis;
1716
use RedisException;
1817
use RobiNN\Pca\Config;
@@ -89,7 +88,7 @@ private function connect(array $server): Redis {
8988
} else {
9089
$redis->connect($server['host'], (int) $server['port'], 3);
9190
}
92-
} catch (Exception $e) {
91+
} catch (RedisException $e) {
9392
throw new DashboardException(
9493
sprintf('Failed to connect to Redis server %s. Error: %s', $redis_server, $e->getMessage())
9594
);
@@ -99,15 +98,15 @@ private function connect(array $server): Redis {
9998
if (isset($server['password'])) {
10099
$redis->auth($server['password']);
101100
}
102-
} catch (Exception $e) {
101+
} catch (RedisException $e) {
103102
throw new DashboardException(
104103
sprintf('Could not authenticate with Redis server %s. Error: %s', $redis_server, $e->getMessage())
105104
);
106105
}
107106

108107
try {
109108
$redis->select(Http::get('db', 'int', $server['database'] ?? 0));
110-
} catch (Exception $e) {
109+
} catch (RedisException $e) {
111110
throw new DashboardException(
112111
sprintf('Could not select Redis database %s. Error: %s', $redis_server, $e->getMessage())
113112
);

0 commit comments

Comments
 (0)