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

Laukik Chitnis updated PIG-1612:
--------------------------------

    Attachment: PIG-1612-3.patch

Incorporating some minor changes from the code review.

{noformat}
     [exec]
     [exec] +1 overall.
     [exec]
     [exec]     +1 @author.  The patch does not contain any @author tags.
     [exec]
     [exec]     +1 tests included.  The patch appears to include 3 new or 
modified tests.
     [exec]
     [exec]     +1 javadoc.  The javadoc tool did not generate any warning 
messages.
     [exec]
     [exec]     +1 javac.  The applied patch does not increase the total number 
of javac compiler warnings.
     [exec]
     [exec]     +1 findbugs.  The patch does not introduce any new Findbugs 
warnings.
     [exec]
     [exec]     +1 release audit.  The applied patch does not increase the 
total number of release audit warnings.
     [exec]
{noformat}

> error reporting: PigException needs to have a way to indicate that its 
> message is appropriate for user
> ------------------------------------------------------------------------------------------------------
>
>                 Key: PIG-1612
>                 URL: https://issues.apache.org/jira/browse/PIG-1612
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Thejas M Nair
>            Assignee: Laukik Chitnis
>             Fix For: 0.9.0
>
>         Attachments: PIG-1612-2.patch, PIG-1612-3.patch
>
>
> The error message printed to the user by pig is the message from the 
> exception that is the 'root cause' from the chain of getCause() of exception 
> that has been thrown. But often the 'root cause' exception does not have 
> enough context that would make for a better error message. It should be 
> possible for a PigException to indicate to the code that determines the error 
> message that its getMessage() string should be used instead of that of the 
> 'cause' exception.
> The following code in LogUtils.java is used to determine the exception that 
> is the 'root cause' -
> {code}
>     public static PigException getPigException(Throwable top) {
>         Throwable current = top;
>         Throwable pigException = top;
>         while (current != null && current.getCause() != null){
>             current = current.getCause();
>             if((current instanceof PigException) && 
> (((PigException)current).getErrorCode() != 0)) {
>                 pigException = current;
>             }
>         }
>         return (pigException instanceof PigException? 
> (PigException)pigException : null);
>         
>     }
> {code}

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

Reply via email to