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

Olivier Lamy commented on MINDEXER-43:
--------------------------------------

This project has moved from Jira to GitHub Issues. This issue was migrated to 
[apache/maven-indexer#517|https://github.com/apache/maven-indexer/issues/517]. 

> WagonFetch.retrieve swallows root causes of problems
> ----------------------------------------------------
>
>                 Key: MINDEXER-43
>                 URL: https://issues.apache.org/jira/browse/MINDEXER-43
>             Project: Maven Indexer (Moved to GitHub Issues)
>          Issue Type: Bug
>    Affects Versions: 4.1.2
>            Reporter: Jesse N. Glick
>            Assignee: Olivier Lamy
>            Priority: Minor
>             Fix For: 4.1.3
>
>
> {{WagonFetch.retrieve}} catches {{AuthorizationException}}, 
> {{ResourceDoesNotExistException}}, and {{WagonException}} and rethrows as 
> {{IOException}} without including the original exception as a cause. This may 
> make it more difficult to diagnose errors: while 
> {{TransferListener.transferError}} will receive the root exception, it may 
> not be obvious that an error here is the "final" error (e.g. if a {{.gz}} 
> index cannot be found but a {{.zip}} can); inspecting the final 
> {{IOException}} from {{IndexUpdater.fetchAndUpdateIndex}} is more convenient.
> Fix should be easy: in {{retrieve}}, replace the three occurrences of
> {code:java}
> throw new SomeException( ... );
> {code}
> with
> {code:java}
> SomeException e2 = new SomeException( ... );
> e2.initCause( e );
> throw e2;
> {code}
> ({{IOException}} has a constructor to do this directly in JDK 6 but I guess 
> you are compatible with JDK 5. Anyway {{FileNotFoundException}} still does 
> not.)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to