[
https://issues.apache.org/jira/browse/HADOOP-12074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14577243#comment-14577243
]
Lavkesh Lahngir commented on HADOOP-12074:
------------------------------------------
Apart from default constructor InterruptedIOException has a constructor which
takes string argument.
So no way to directly do new InterruptedIOException(cause).
we could do.
{code}
catch(InterruptedException ie) {
InterruptedIOException iioe = new InterruptedIOException(ie.getMessage());
iioe.initCause(ie);
throw iioe;
}
{code}
Or Instead of InterruptedIOException we can just throw an IOException with
cause ie.
{code}
catch(InterruptedException ie) {
throw newIOException(ie);
}
{code}
I feel that cause should be preserved, while wrapping exceptions.
> in Shell.java#runCommand() while catching InterruptedException, throw new
> IOException(ie) instead of IOException(ie.getMessage())
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: HADOOP-12074
> URL: https://issues.apache.org/jira/browse/HADOOP-12074
> Project: Hadoop Common
> Issue Type: Bug
> Reporter: Lavkesh Lahngir
> Assignee: Lavkesh Lahngir
> Priority: Trivial
>
> Instead of creating IOException with message make InterruptedException the
> cause of IOException, so that whoever calling shell executor can make use of
> it.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)