From ba98da74bf0cb74f467ea3765339ef438e86bfe8 Mon Sep 17 00:00:00 2001 From: zyfx595701088 <50442211+zyfx595701088@users.noreply.github.com> Date: Tue, 16 Jul 2024 19:14:36 +0800 Subject: [PATCH] Extract messages of unsupported exception as constants (#3887) Co-authored-by: zhangshuai Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> --- .../jedis/mcf/MultiClusterTransaction.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/redis/clients/jedis/mcf/MultiClusterTransaction.java b/src/main/java/redis/clients/jedis/mcf/MultiClusterTransaction.java index f39cdf36b6..7356f9ba79 100644 --- a/src/main/java/redis/clients/jedis/mcf/MultiClusterTransaction.java +++ b/src/main/java/redis/clients/jedis/mcf/MultiClusterTransaction.java @@ -27,6 +27,8 @@ public class MultiClusterTransaction extends TransactionBase { private static final Builder NO_OP_BUILDER = BuilderFactory.RAW_OBJECT; + + private static final String GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE = "Graph commands are not supported."; private final CircuitBreakerFailoverConnectionProvider failoverProvider; private final AtomicInteger extraCommandCount = new AtomicInteger(); @@ -213,52 +215,52 @@ public final String discard() { // RedisGraph commands @Override public Response graphQuery(String name, String query) { - throw new UnsupportedOperationException("Graph commands are not supported."); + throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE); } @Override public Response graphReadonlyQuery(String name, String query) { - throw new UnsupportedOperationException("Graph commands are not supported."); + throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE); } @Override public Response graphQuery(String name, String query, long timeout) { - throw new UnsupportedOperationException("Graph commands are not supported."); + throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE); } @Override public Response graphReadonlyQuery(String name, String query, long timeout) { - throw new UnsupportedOperationException("Graph commands are not supported."); + throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE); } @Override public Response graphQuery(String name, String query, Map params) { - throw new UnsupportedOperationException("Graph commands are not supported."); + throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE); } @Override public Response graphReadonlyQuery(String name, String query, Map params) { - throw new UnsupportedOperationException("Graph commands are not supported."); + throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE); } @Override public Response graphQuery(String name, String query, Map params, long timeout) { - throw new UnsupportedOperationException("Graph commands are not supported."); + throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE); } @Override public Response graphReadonlyQuery(String name, String query, Map params, long timeout) { - throw new UnsupportedOperationException("Graph commands are not supported."); + throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE); } @Override public Response graphDelete(String name) { - throw new UnsupportedOperationException("Graph commands are not supported."); + throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE); } @Override public Response> graphProfile(String graphName, String query) { - throw new UnsupportedOperationException("Graph commands are not supported."); + throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE); } // RedisGraph commands }