continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r563506 - in /maven/continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
Date Tue, 07 Aug 2007 14:15:12 GMT
Author: evenisse
Date: Tue Aug  7 07:15:11 2007
New Revision: 563506

URL: http://svn.apache.org/viewvc?view=rev&rev=563506
Log:
[CONTINUUM-927] Print a message error instead of an exception when a user try to remove a
used schedule.

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?view=diff&rev=563506&r1=563505&r2=563506
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Tue Aug  7 07:15:11 2007
@@ -1009,7 +1009,7 @@
             throw logAndCreateException( "Exception while getting build result for project.",
e );
         }
     }
-    
+
     public void removeBuildResult( int buildId )
         throws ContinuumException
     {
@@ -2088,10 +2088,27 @@
         }
         catch ( SchedulesActivationException e )
         {
-            getLogger().error( "Can't unactivate schedule. You need to restart Continuum.",
e );
+            getLogger().error( "Can't unactivate the schedule. You need to restart Continuum.",
e );
+        }
+
+        try
+        {
+            store.removeSchedule( schedule );
         }
+        catch ( Exception e )
+        {
+            getLogger().error( "Can't remove the schedule.", e );
 
-        store.removeSchedule( schedule );
+            try
+            {
+                schedulesActivator.activateSchedule( schedule, this );
+            }
+            catch ( SchedulesActivationException sae )
+            {
+                getLogger().error( "Can't reactivate the schedule. You need to restart Continuum.",
e );
+            }
+            throw new ContinuumException( "Can't remove the schedule", e );
+        }
     }
 
     public Schedule storeSchedule( Schedule schedule )

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java?view=diff&rev=563506&r1=563505&r2=563506
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
Tue Aug  7 07:15:11 2007
@@ -24,6 +24,7 @@
 import org.apache.maven.continuum.web.exception.AuthenticationRequiredException;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
 
+import javax.jdo.JDODataStoreException;
 import java.util.Collection;
 
 /**
@@ -231,7 +232,14 @@
 
         if ( confirmed )
         {
-            getContinuum().removeSchedule( id );
+            try
+            {
+                getContinuum().removeSchedule( id );
+            }
+            catch ( ContinuumException e )
+            {
+                addActionError( "schedule.remove.error" );
+            }
         }
         else
         {



Mime
View raw message