[ 
https://issues.apache.org/jira/browse/HADOOP-14788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16183926#comment-16183926
 ] 

Steve Loughran commented on HADOOP-14788:
-----------------------------------------

wow, you even did the image IO ones. Thanks for this.

* {{InterruptedIOException}} : & subclasses. Pass up unwrapped as that's either 
an interrupted thread or some socket error
* {{PathIOException}} unwrapped, because it will already include a path
* And we should make the new exception raised a PathIOException, giving it the 
path explicitly. Lets callers get that path back, if they want. Path IOEs 
generate their own message, including that path in, so the message passed in 
could be tuned.

Testing. L312 just throw than exception in a try/catch clause, have the catch 
filter on IOE only, and generic test utils inside; rethrow on the Exception if 
there's a mismatch (so its stack is included in the teest logs)

Or use the new LambdaTestUtils.intercept:

{code}
PathException ex = LambdaTestUtils.intercept(PathException.class, "in 
method:[testWrapException]", 
  () -> { throw IOUtils.wrapException("file:///tmp/abc.txt", 
"testWrapException", ex) });
if (!ex.getPath().equals(new Path("file:///tmp/abc.txt") { throw ex; }
{code}



> Credentials readTokenStorageFile to stop wrapping IOEs in IOEs
> --------------------------------------------------------------
>
>                 Key: HADOOP-14788
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14788
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 2.8.1
>            Reporter: Steve Loughran
>            Assignee: Ajay Kumar
>            Priority: Minor
>         Attachments: HADOOP-14788.001.patch
>
>
> When {{Credentials readTokenStorageFile}} gets an IOE. it catches & wraps 
> with the filename, so losing the exception class information.
> Is this needed. or can it pass everything up?
> If it is needed, well, it's a common pattern: wrapping the exception with the 
> path & operation. Maybe it's time to add an IOE version of 
> {{NetworkUtils.wrapException()}} which handles the broader set of IOEs



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to