Github user hsaputra commented on the pull request:

    https://github.com/apache/flink/pull/351#issuecomment-72162452
  
    To reduce code duplication and tracing, we could just throw the exception 
inside createInput(InputFormat<X, ?> inputFormat, TypeInformation<X> 
producedType) by wrapping IllegalArgumentException with InvalidProgramException:
    
    {code}
    public <X> DataSource<X> createInput(InputFormat<X, ?> inputFormat, 
                                                                  
TypeInformation<X> producedType) {
      try {
        Preconditions.checkArgument (inputFormat != null, "InputFormat must not 
be null.");
        Preconditions.checkArgument (producedType != null, 
          "Produced type information must not be null.");
      } catch (IllegalArgumentException iaex) {
        throw new InvalidProgramException(
        "The type returned by the input format could not be automatically 
determined. " + 
        " Please specify the TypeInformation of the produced type explicitly by 
using "
        + " the createInput(InputFormat, TypeInformation)' method instead.", 
iaex);
      }         
      
      return new DataSource<X>(this, inputFormat, producedType, 
Utils.getCallLocationName());
    }
    {code}
    
    So the other createInput methods callers dont have to deal with the 
exception.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to