ijuma commented on code in PR #12230:
URL: https://github.com/apache/kafka/pull/12230#discussion_r956053947
##########
clients/src/main/java/org/apache/kafka/common/utils/Utils.java:
##########
@@ -463,8 +463,7 @@ public static <T> T newParameterizedInstance(String
className, Object... params)
throw new ClassNotFoundException(String.format("Unable to access "
+
"constructor of %s", className), e);
} catch (InvocationTargetException e) {
- throw new ClassNotFoundException(String.format("Unable to invoke "
+
- "constructor of %s", className), e);
+ throw new KafkaException(String.format("The constructor of %s
threw an exception", className), e.getCause());
Review Comment:
The caller may be itself generic code. For example, see what happened here:
https://github.com/apache/kafka/pull/12230/files#diff-ac079c35d502aee90e8bbfa3b71cd9deda5ad4ffb49364fcc23a9278a848241cR79
The method now throws `Throwable`. It was pretty hard for me to say whether
we needed to update some code to handle other exceptions. Is it clear to you?
--
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]