[
https://issues.apache.org/jira/browse/MINDEXER-45?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17965234#comment-17965234
]
Olivier Lamy commented on MINDEXER-45:
--------------------------------------
This project has moved from Jira to GitHub Issues. This issue was migrated to
[apache/maven-indexer#469|https://github.com/apache/maven-indexer/issues/469].
> WagonFetcher.disconnect should throw IOException
> ------------------------------------------------
>
> Key: MINDEXER-45
> URL: https://issues.apache.org/jira/browse/MINDEXER-45
> 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
>
>
> {{WagonHelper.WagonFetcher.disconnect}} catches {{ConnectionException}} and
> logs it, but does not throw anything. Since the interface method is
> documented to throw {{IOException}}, it should rather rethrow the exception.
> {code}
> diff --git
> a/indexer-core/src/main/java/org/apache/maven/index/updater/WagonHelper.java
> b/indexer-core/src/main/java/org/apache/maven/index/updater/WagonHelper.java
> index 399dd83..79f3606 100644
> ---
> a/indexer-core/src/main/java/org/apache/maven/index/updater/WagonHelper.java
> +++
> b/indexer-core/src/main/java/org/apache/maven/index/updater/WagonHelper.java
> @@ -145,6 +145,7 @@ public class WagonHelper
> }
>
> public void disconnect()
> + throws IOException
> {
> if ( wagon != null )
> {
> @@ -154,7 +155,9 @@ public class WagonHelper
> }
> catch ( ConnectionException ex )
> {
> - logError( "Failed to close connection", ex );
> + IOException ioe = new IOException( ex.toString() );
> + ioe.initCause( ex );
> + throw ioe;
> }
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)