You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by li...@apache.org on 2022/06/30 11:18:40 UTC
[rocketmq-clients] branch cpp updated: Add error handling for NotifyClientTermination
This is an automated email from the ASF dual-hosted git repository.
lizhanhui pushed a commit to branch cpp
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git
The following commit(s) were added to refs/heads/cpp by this push:
new 770da2b Add error handling for NotifyClientTermination
770da2b is described below
commit 770da2b01e04057849ea501071df0555839bed22
Author: Li Zhanhui <li...@gmail.com>
AuthorDate: Thu Jun 30 19:18:32 2022 +0800
Add error handling for NotifyClientTermination
---
cpp/src/main/cpp/client/ClientManagerImpl.cpp | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/cpp/src/main/cpp/client/ClientManagerImpl.cpp b/cpp/src/main/cpp/client/ClientManagerImpl.cpp
index 1602769..8d182d8 100644
--- a/cpp/src/main/cpp/client/ClientManagerImpl.cpp
+++ b/cpp/src/main/cpp/client/ClientManagerImpl.cpp
@@ -1392,26 +1392,36 @@ std::error_code ClientManagerImpl::notifyClientTermination(const std::string& ta
SPDLOG_DEBUG("NotifyClientTermination OK. host={}", target_host);
break;
}
+
+ case rmq::Code::ILLEGAL_CONSUMER_GROUP: {
+ SPDLOG_ERROR("IllegalConsumerGroup: {}. Host={}", status.message(), target_host);
+ ec = ErrorCode::IllegalConsumerGroup;
+ break;
+ }
+
case rmq::Code::INTERNAL_SERVER_ERROR: {
SPDLOG_WARN("InternalServerError: Cause={}, host={}", status.message(), target_host);
ec = ErrorCode::InternalServerError;
break;
}
+
case rmq::Code::UNAUTHORIZED: {
SPDLOG_WARN("Unauthorized due to lack of valid authentication credentials: Cause={}, host={}", status.message(),
target_host);
ec = ErrorCode::Unauthorized;
break;
}
+
case rmq::Code::FORBIDDEN: {
SPDLOG_WARN("Forbidden due to insufficient permission to the resource: Cause={}, host={}", status.message(),
target_host);
ec = ErrorCode::Forbidden;
break;
}
+
default: {
- SPDLOG_WARN("NotImplemented. Please upgrade to latest SDK release. host={}", target_host);
- ec = ErrorCode::NotImplemented;
+ SPDLOG_WARN("NotSupported. Please upgrade to latest SDK release. host={}", target_host);
+ ec = ErrorCode::NotSupported;
break;
}
}