File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313namespace RobiNN \Pca \Dashboards \Redis ;
1414
15- use Exception ;
1615use Redis ;
1716use RedisException ;
1817use 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 );
You can’t perform that action at this time.
0 commit comments