File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
driver/src/main/java/jdbc Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,14 @@ public void checkMode() throws SQLException {
4444 }
4545 RedisMode clientMode = client .getMode ();
4646 if (clientMode != serverMode ) {
47+ String clientModeName = toLowerCase (clientMode .name ());
48+ String serverModeName = toLowerCase (serverMode .name ());
4749 String serverURLPrefix = RedisClientFactory .getURLPrefix (serverMode );
48- String urlFix = serverURLPrefix != null ? String .format ("\n Please change the URL prefix to \" %s\" ." , serverURLPrefix ) : null ;
49- throw new SQLException (String .format ("The connection mode \" %s\" does not match the server mode \" %s\" .%s" ,
50- toLowerCase (clientMode .name ()), toLowerCase (serverMode .name ()), urlFix ));
50+ String messageTail = serverURLPrefix != null
51+ ? String .format ("Please change the URL prefix to \" %s\" ." , serverURLPrefix )
52+ : String .format ("Meanwhile, the connection mode \" %s\" is not supported at the moment." , serverModeName );
53+ throw new SQLException (String .format ("The connection mode \" %s\" does not match the server mode \" %s\" .\n %s" ,
54+ clientModeName , serverModeName , messageTail ));
5155 }
5256 }
5357
You can’t perform that action at this time.
0 commit comments