Technoboy- commented on code in PR #14153:
URL: https://github.com/apache/pulsar/pull/14153#discussion_r865611737
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:
##########
@@ -4154,18 +4175,18 @@ private void validateClientVersion() {
if (splits != null && splits.length > 1) {
if
(LEAST_SUPPORTED_CLIENT_VERSION_PREFIX.getMajorVersion() >
Integer.parseInt(splits[0])
||
LEAST_SUPPORTED_CLIENT_VERSION_PREFIX.getMinorVersion() >
Integer.parseInt(splits[1])) {
- throw new RestException(Status.METHOD_NOT_ALLOWED,
+ return FutureUtil.failedFuture(new
RestException(Status.METHOD_NOT_ALLOWED,
"Client lib is not compatible to access
partitioned metadata: version " + userAgent
- + " is not supported");
+ + " is not supported"));
}
}
} catch (RestException re) {
- throw re;
+ return FutureUtil.failedFuture(re);
} catch (Exception e) {
log.warn("[{}] Failed to parse version {} ", clientAppId(),
userAgent);
Review Comment:
Seems that: `Integer.parseInt` may throw exceptions(so we need to catch),
but never go into the exception.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]