maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesse Glick (JIRA)" <j...@codehaus.org>
Subject [jira] Created: (MINDEXER-45) WagonFetcher.disconnect should throw IOException
Date Tue, 01 Nov 2011 18:33:51 GMT
WagonFetcher.disconnect should throw IOException
------------------------------------------------

                 Key: MINDEXER-45
                 URL: https://jira.codehaus.org/browse/MINDEXER-45
             Project: Maven Indexer
          Issue Type: Bug
    Affects Versions: 4.1.2
            Reporter: Jesse Glick
            Priority: Minor


{{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 is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message