You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Cheolsoo Park (JIRA)" <ji...@apache.org> on 2014/03/14 02:21:45 UTC
[jira] [Commented] (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:comment-tabpanel&focusedCommentId=13934412#comment-13934412 ]
Cheolsoo Park commented on PIG-3811:
------------------------------------
[~prkommireddi], I see the same code in ToolsPigServer and org.apache.pig.pigunit.pig.PigServer. Should we change them too?
> 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)