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

Olga Natkovich updated PIG-1611:
--------------------------------

    Release Note:   (was: 0.9 is already quite crowded with massive changes 
including parser and logical plan switch. Delaying this to avoid further 
distabilization and lots of additional work. Lets consider for the next release)

0.9 is already quite crowded with massive changes including parser and logical 
plan switch. Delaying this to avoid further distabilization and lots of 
additional work. Lets consider for the next release

> use enums for error code
> ------------------------
>
>                 Key: PIG-1611
>                 URL: https://issues.apache.org/jira/browse/PIG-1611
>             Project: Pig
>          Issue Type: Sub-task
>            Reporter: Thejas M Nair
>         Attachments: PIG-1611.1.patch
>
>
> Pig code is using integer constants for error code, and the value of the 
> error code is reserved using 
> http://wiki.apache.org/pig/PigErrorHandlingFunctionalSpecification .
> This process is cumbersome and error prone.
> It will be better to use enum values instead. The enum value can contain the 
> error message and encapsulate the error code. 
> For example -
> {code}
> Replace 
> throw new SchemaMergeException("Error in merging schema", 2124, 
> PigException.BUG); 
> with
> throw new SchemaMergeException(SCHEMA_MERGE_EX, PigException.BUG); 
> {code}
> Where SCHEMA_MERGE_EX belongs to a error codes enum. We can use the ordinal 
> value of the enum and an offset to determine the error code. 
> The error code will be passed through the constructor of the enum.
> {code}
> SCHEMA_MERGE_EX("Error in merging schema");
> {code}
> For documentation, the error code and error messages can be dumped using code 
> that uses the enum error code class.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to