TheNeuralBit commented on a change in pull request #14098:
URL: https://github.com/apache/beam/pull/14098#discussion_r583289987
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/util/InstanceBuilder.java
##########
@@ -221,11 +221,21 @@ private T buildFromMethod(Class<?>[] types) {
String.format(
"Unable to find factory method %s#%s(%s)",
factoryClass.getSimpleName(), methodName, Joiner.on(",
").join(types)));
-
- } catch (IllegalAccessException | InvocationTargetException e) {
+ } catch (InvocationTargetException e) {
+ if (e.getTargetException() instanceof RuntimeException) {
+ // If underlying exception is unchecked re-raise it as-is
+ throw (RuntimeException) e.getTargetException();
+ } else {
Review comment:
:) thanks, fixed
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]