@@ -68,7 +68,7 @@ private synchronized Object execute(@NotNull HostAndPort nodeHostAndPort,
6868 ConnectionPool nodePool = nodes .get (nodeKey );
6969 Connection nodeConnection = nodePool != null ? nodePool .getResource () : null ;
7070 if (nodeConnection == null )
71- throw new SQLException (String .format ("Cluster node not found: %s" , nodeHostAndPort ));
71+ throw new SQLException (String .format ("Cluster node not found: %s. " , nodeHostAndPort ));
7272 return nodeConnection ;
7373 }
7474
@@ -82,8 +82,8 @@ protected Object executeImpl(@NotNull RedisKeyPatternQuery query) throws SQLExce
8282 private static void checkSupportInClusterMode (@ NotNull RedisKeyPatternQuery query ) throws SQLException {
8383 String keyPattern = query .getKeyPattern ();
8484 if (keyPattern == null || !JedisClusterHashTag .isClusterCompliantMatchPattern (keyPattern ))
85- throw new SQLException (String .format ("Cluster mode only supports %s command"
86- + " with pattern containing hash-tag ( curly-brackets enclosed string ) " , query .getCommand ()));
85+ throw new SQLException (String .format ("Cluster mode only supports the %s command"
86+ + " with a pattern containing a hash-tag (curly-brackets enclosed string). " , query .getCommand ()));
8787 }
8888
8989
@@ -107,15 +107,14 @@ protected synchronized Object executeImpl(@NotNull RedisQuery query) throws SQLE
107107 private static void checkSupportInClusterMode (@ NotNull RedisQuery query ) throws SQLException {
108108 Command command = query .getCommand ();
109109 if (UNSUPPORTED_COMMANDS .contains (command ))
110- throw new SQLException (String .format ("Cluster mode does not support %s command" , command ));
110+ throw new SQLException (String .format ("Cluster mode does not support the %s command. " , command ));
111111 }
112112
113113
114114 @ Override
115115 protected String setDatabase (int index ) {
116116 if (index == 0 ) return "OK" ;
117- // TODO (cluster): unify
118- throw new JedisDataException ("ERR SELECT is not allowed in cluster mode" );
117+ throw new JedisDataException ("ERR DB index is out of range" );
119118 }
120119
121120 @ Override
0 commit comments