From e088f2ead90602577a3a584d5129429970e4ace5 Mon Sep 17 00:00:00 2001 From: Demogorgon314 Date: Fri, 7 Aug 2020 17:48:39 +0800 Subject: [PATCH] keep compatibility --- .../rocketmq/client/exception/MQBrokerException.java | 8 ++++++++ .../org/apache/rocketmq/client/impl/MQClientAPIImpl.java | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/client/src/main/java/org/apache/rocketmq/client/exception/MQBrokerException.java b/client/src/main/java/org/apache/rocketmq/client/exception/MQBrokerException.java index 5db60e38..f07a38b8 100644 --- a/client/src/main/java/org/apache/rocketmq/client/exception/MQBrokerException.java +++ b/client/src/main/java/org/apache/rocketmq/client/exception/MQBrokerException.java @@ -25,6 +25,14 @@ public class MQBrokerException extends Exception { private final String errorMessage; private final String brokerAddr; + public MQBrokerException(int responseCode, String errorMessage) { + super(FAQUrl.attachDefaultURL("CODE: " + UtilAll.responseCode2String(responseCode) + " DESC: " + + errorMessage)); + this.responseCode = responseCode; + this.errorMessage = errorMessage; + this.brokerAddr = null; + } + public MQBrokerException(int responseCode, String errorMessage, String brokerAddr) { super(FAQUrl.attachDefaultURL("CODE: " + UtilAll.responseCode2String(responseCode) + " DESC: " + errorMessage + (brokerAddr != null ? " BROKER: " + brokerAddr : ""))); diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java b/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java index 8ae90574..7a4d5565 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java @@ -1340,7 +1340,7 @@ public class MQClientAPIImpl { break; } - throw new MQBrokerException(response.getCode(), response.getRemark(), null); + throw new MQBrokerException(response.getCode(), response.getRemark()); } public TopicRouteData getDefaultTopicRouteInfoFromNameServer(final String topic, final long timeoutMillis) -- GitLab