You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jesse Glick (JIRA)" <ji...@codehaus.org> on 2011/11/01 19:33:51 UTC

[jira] Created: (MINDEXER-45) WagonFetcher.disconnect should throw IOException

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

        

[jira] Closed: (MINDEXER-45) WagonFetcher.disconnect should throw IOException

Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MINDEXER-45?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Lamy closed MINDEXER-45.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 4.1.3
         Assignee: Olivier Lamy

fixed r1198070
Thanks!

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