pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prashant Kommireddi (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PIG-3811) PigServer.registerScript() wraps exception incorrectly on parsing errors
Date Thu, 13 Mar 2014 23:11:45 GMT

     [ 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)

Mime
View raw message