You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Prashant Kommireddi (JIRA)" <ji...@apache.org> on 2014/03/14 00:11:45 UTC

[jira] [Updated] (PIG-3811) PigServer.registerScript() wraps exception incorrectly on parsing errors

     [ https://issues.apache.org/jira/browse/PIG-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Prashant Kommireddi updated PIG-3811:
-------------------------------------

    Attachment: PIG-3811.patch

Straightforward fix.

> 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
>
>         Attachments: PIG-3811.patch
>
>
> 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)