yifan-c commented on code in PR #59:
URL: https://github.com/apache/cassandra-sidecar/pull/59#discussion_r1260306236
##########
common/src/main/java/org/apache/cassandra/sidecar/common/JmxClient.java:
##########
@@ -158,6 +162,14 @@ private void connect()
throw new RuntimeException(String.format("Failed to connect to JMX
endpoint %s", jmxServiceURL),
iox);
}
+ catch (SecurityException securityException)
+ {
+ connected = false;
+ String errorMessage = securityException.getMessage() != null
+ ? securityException.getMessage()
+ : "JMX Authentication failed";
+ throw new JmxAuthenticationException(errorMessage,
securityException);
+ }
Review Comment:
Talked offline. The thrown runtime exception needs to be wrapped in a
dedicated exception type to avoid being caught and handled unexpectedly.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]