ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gscok...@apache.org
Subject svn commit: r766667 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java
Date Mon, 20 Apr 2009 12:12:01 GMT
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");                
             }
         }
     }



Mime
View raw message