Prashant Kommireddi created PIG-3811:
----------------------------------------

             Summary: PigServer.registerScript() wraps exception incorrectly on 
parsing errors
                 Key: PIG-3811
                 URL: https://issues.apache.org/jira/browse/PIG-3811
             Project: Pig
          Issue Type: Bug
    Affects Versions: 0.12.0
            Reporter: Prashant Kommireddi
            Assignee: Prashant Kommireddi
             Fix For: 0.13.0


PigServer.registerScript throws an IOException that is wrapped on the cause of 
ParseException in case there were parsing errors in the script.

{code}
    public void registerScript(InputStream in, Map<String,String> 
params,List<String> paramsFiles) throws IOException {
        try {
            String substituted = pigContext.doParamSubstitution(in, 
paramMapToList(params), paramsFiles);
            GruntParser grunt = new GruntParser(new StringReader(substituted));
            grunt.setInteractive(false);
            grunt.setParams(this);
            grunt.parseStopOnError(true);
        } catch (org.apache.pig.tools.pigscript.parser.ParseException e) {
            log.error(e.getLocalizedMessage());
            throw new IOException(e.getCause());
        }
    }
{code}

{{e.getCause()}} however would be null and the IOException returned is actually 
an empty exception with null contents.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to