You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Alan Gates (JIRA)" <ji...@apache.org> on 2008/02/13 02:21:08 UTC

[jira] Commented: (PIG-80) Stacktrace information is lost at MapReduceLauncher.java:289

    [ https://issues.apache.org/jira/browse/PIG-80?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568392#action_12568392 ] 

Alan Gates commented on PIG-80:
-------------------------------

In general, the patch looks fine.  But I was wondering if we could make it more general.  Instead of having a class specifically for wrapping IOExceptions, could we have something like this:

public class ExceptionWrapper {

    public static <T extends Throwable> wrap(T toThrow Throwable thrown) {
           toThrow.initCause(t);
           return toThrow;
     }
}

Callers would then do something like:  

throw ExceptionWrapper.wrap(new MyException("whoa, that didn't work"), e);

This way all types of exception could be wrapped, instead of just IOExceptions.

> Stacktrace information is lost at MapReduceLauncher.java:289
> ------------------------------------------------------------
>
>                 Key: PIG-80
>                 URL: https://issues.apache.org/jira/browse/PIG-80
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-80-v01.patch, PIG-80-v02.patch, PIG-80-v03.patch, PIG-80-v04.patch, PIG-80-v05.patch
>
>
> {code:java}
> ...
> }catch (Exception e) {
>     // Do we need different handling for different exceptions
>     e.printStackTrace();
>     throw new IOException(e.getMessage());
> }finally{ ...
> {code}
> in my case the sandard output is redirtected to /dev/null so "e.printStackTrace();" is lost.
> it should be :
> {code:java}throw new IOException(e);{code} 
> no getMessage() because we loose the rest of the stacktrace

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.