Hi all,

Currently, if a required option is missing for a Beam pipeline, the error
message is like

>
> Exception in thread "main" java.lang.IllegalArgumentException: Missing
> required value for [public abstract java.lang.String
> org.apache.beam.examples.WordCount$WordCountOptions.getOutput(), "Path of
> the file to write to"].


This is quite long but doesn't give any hint to users about the required
option. Instead, I'm thinking about something like

Exception in thread "main" java.lang.IllegalArgumentException: Missing
> required option [--output, "Path of the file to write to"].


It can be achieved by adding a method that *returns the option from a
method* to  ProxyInvocationHandler
<https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/options/ProxyInvocationHandler.java>
 class.

public String getOption(Method method) {
  return gettersToPropertyNames.get(method.getName());
}


This may look general for ProxyInvocationHandler but you get the idea.

WDYT?

Thanks,
Manu

Reply via email to