You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by gs...@apache.org on 2009/04/20 14:12:01 UTC

svn commit: r766667 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java

Author: gscokart
Date: Mon Apr 20 12:12:01 2009
New Revision: 766667

URL: http://svn.apache.org/viewvc?rev=766667&view=rev
Log:
provides correct exception in case of error during initialisation of the transaction (usually it is followed by an abort that will fail and hide the original error)

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java?rev=766667&r1=766666&r2=766667&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java Mon Apr 20 12:12:01 2009
@@ -121,14 +121,15 @@
 
     public void abortPublishTransaction() throws IOException {
         if (supportTransaction()) {
-            if (!isTransactionStarted()) {
-                throw new IllegalStateException("no current transaction!");
-            }
-            try {
-                getFileRepository().delete(transactionTempDir);
-                Message.info("\tpublish aborted: deleted " + transactionTempDir);
-            } finally {
-                closeTransaction();
+            if (isTransactionStarted()) {                
+                try {
+                    getFileRepository().delete(transactionTempDir);
+                    Message.info("\tpublish aborted: deleted " + transactionTempDir);
+                } finally {
+                    closeTransaction();
+                }
+            } else { 
+                Message.info("\tpublish aborted: nothing was started");                
             }
         }
     }