[
https://issues.apache.org/jira/browse/BEAM-11870?focusedWorklogId=558299&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-558299
]
ASF GitHub Bot logged work on BEAM-11870:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 25/Feb/21 23:43
Start Date: 25/Feb/21 23:43
Worklog Time Spent: 10m
Work Description: apilloud commented on a change in pull request #14098:
URL: https://github.com/apache/beam/pull/14098#discussion_r583282551
##########
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:
nit: this `else` is unnecessary...
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 558299)
Time Spent: 40m (was: 0.5h)
> IllegalArgumentExceptions from Runner.fromOptions in Pipeline.create should
> be raised as-is
> -------------------------------------------------------------------------------------------
>
> Key: BEAM-11870
> URL: https://issues.apache.org/jira/browse/BEAM-11870
> Project: Beam
> Issue Type: Improvement
> Components: runner-core
> Reporter: Brian Hulette
> Assignee: Brian Hulette
> Priority: P2
> Time Spent: 40m
> Remaining Estimate: 0h
>
> Currently if Runner.fromOptions raises an IllegalArgumentException, it gets
> wrapped in an InvocationTargetException and a RuntimeException, which doesn't
> add any vallue. We should just re-raise the underlying exception instead.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)