continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1395451 - in /continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ resources/
Date Mon, 08 Oct 2012 05:06:19 GMT
Author: brett
Date: Mon Oct  8 05:06:18 2012
New Revision: 1395451

URL: http://svn.apache.org/viewvc?rev=1395451&view=rev
Log:
[CONTINUUM-2689] release error page incorrectly displayed for unexpected exceptions

Use separate action results for release errors and exceptions

Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseCleanupAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
    continuum/trunk/continuum-webapp/src/main/resources/struts.xml

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java?rev=1395451&r1=1395450&r2=1395451&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
Mon Oct  8 05:06:18 2012
@@ -57,6 +57,8 @@ public class ContinuumActionSupport
 
     protected static final String REQUIRES_AUTHORIZATION = "requires-authorization";
 
+    protected static final String RELEASE_ERROR = "releaseError";
+
     protected static final String ERROR_MSG_AUTHORIZATION_REQUIRED = "You are not authorized
to access this page. " +
         "Please contact your administrator to be granted the appropriate permissions.";
 

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseCleanupAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseCleanupAction.java?rev=1395451&r1=1395450&r2=1395451&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseCleanupAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseCleanupAction.java
Mon Oct  8 05:06:18 2012
@@ -79,7 +79,7 @@ public class ReleaseCleanupAction
                 args.add( e.getMessage() );
 
                 addActionError( getText( "releaseCleanup.error", args ) );
-                return ERROR;
+                return RELEASE_ERROR;
             }
         }
         else

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java?rev=1395451&r1=1395450&r2=1395451&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
Mon Oct  8 05:06:18 2012
@@ -89,7 +89,7 @@ public class ReleaseInProgressAction
                 args.add( e.getMessage() );
 
                 addActionError( getText( "distributedBuild.releaseInProgress.error", args
) );
-                return ERROR;
+                return RELEASE_ERROR;
             }
 
             if ( map != null && !map.isEmpty() )
@@ -218,7 +218,7 @@ public class ReleaseInProgressAction
                 args.add( e.getMessage() );
 
                 addActionError( getText( "releaseViewResult.error", args ) );
-                return ERROR;
+                return RELEASE_ERROR;
             }
         }
         else

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java?rev=1395451&r1=1395450&r2=1395451&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
Mon Oct  8 05:06:18 2012
@@ -124,7 +124,7 @@ public class ReleasePerformAction
             args.add( e.getMessage() );
 
             addActionError( getText( "distributedBuild.releasePerform.input.error", args
) );
-            return ERROR;
+            return RELEASE_ERROR;
         }
 
         populateFromProject();
@@ -158,7 +158,7 @@ public class ReleasePerformAction
             args.add( e.getMessage() );
 
             addActionError( getText( "distributedBuild.releasePerform.input.error", args
) );
-            return ERROR;
+            return RELEASE_ERROR;
         }
 
         return SUCCESS;
@@ -222,7 +222,7 @@ public class ReleasePerformAction
                 args.add( e.getMessage() );
 
                 addActionError( getText( "distributedBuild.releasePerform.release.error",
args ) );
-                return ERROR;
+                return RELEASE_ERROR;
             }
         }
         else
@@ -280,7 +280,7 @@ public class ReleasePerformAction
                 args.add( e.getMessage() );
 
                 addActionError( getText( "distributedBuild.releasePerform.release.error",
args ) );
-                return ERROR;
+                return RELEASE_ERROR;
             }
 
             return SUCCESS;

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java?rev=1395451&r1=1395450&r2=1395451&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
Mon Oct  8 05:06:18 2012
@@ -173,7 +173,7 @@ public class ReleasePrepareAction
                 args.add( e.getMessage() );
 
                 addActionError( getText( "distributedBuild.releasePrepare.input.error", args
) );
-                return ERROR;
+                return RELEASE_ERROR;
             }
         }
         else
@@ -192,7 +192,7 @@ public class ReleasePrepareAction
                 args.add( e.getMessage() );
 
                 addActionError( getText( "releasePrepare.input.error", args ) );
-                return ERROR;
+                return RELEASE_ERROR;
             }
         }
 
@@ -289,7 +289,7 @@ public class ReleasePrepareAction
                 if ( releaseId == null )
                 {
                     addActionError( "Failed to release project" );
-                    return ERROR;
+                    return RELEASE_ERROR;
                 }
             }
             catch ( BuildAgentConfigurationException e )
@@ -298,7 +298,7 @@ public class ReleasePrepareAction
                 args.add( e.getMessage() );
 
                 addActionError( getText( "distributedBuild.releasePrepare.release.error",
args ) );
-                return ERROR;
+                return RELEASE_ERROR;
             }
         }
         else

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java?rev=1395451&r1=1395450&r2=1395451&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
Mon Oct  8 05:06:18 2012
@@ -19,11 +19,13 @@ package org.apache.maven.continuum.web.a
  * under the License.
  */
 
+import org.apache.continuum.configuration.BuildAgentConfigurationException;
 import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
 import org.apache.continuum.web.util.AuditLog;
 import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.release.ContinuumReleaseException;
 import org.apache.maven.continuum.release.ContinuumReleaseManager;
 import org.apache.maven.continuum.release.ContinuumReleaseManagerListener;
 import org.apache.maven.continuum.release.DefaultReleaseManagerListener;
@@ -72,10 +74,22 @@ public class ReleaseRollbackAction
             {
                 releaseManager.releaseRollback( releaseId, projectId );
             }
-            catch ( Exception e )
+            catch ( ContinuumReleaseException e )
             {
-                addActionError( e.getMessage() );
-                return ERROR;
+                if ( e.getMessage() != null )
+                {
+                    addActionError( e.getMessage() );
+                    return RELEASE_ERROR;
+                }
+                else
+                {
+                    throw e;
+                }
+            }
+            catch ( BuildAgentConfigurationException e )
+            {
+                addActionError( "Error with configuration of build agent: " + e.getMessage()
);
+                return RELEASE_ERROR;
             }
         }
         else

Modified: continuum/trunk/continuum-webapp/src/main/resources/struts.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/struts.xml?rev=1395451&r1=1395450&r2=1395451&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/struts.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/struts.xml Mon Oct  8 05:06:18 2012
@@ -593,7 +593,7 @@
 
     <action name="releasePrepareInput" class="releasePrepare" method="input">
       <result name="success">/WEB-INF/jsp/releasePrepare.jsp</result>
-      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
+      <result name="releaseError">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releasePrepare" class="releasePrepare">
@@ -604,12 +604,12 @@
         <param name="projectId">${projectId}</param>
         <param name="releaseGoal">prepare</param>
       </result>
-      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
+      <result name="releaseError">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releasePerformInput" class="releasePerform" method="input">
       <result name="success">/WEB-INF/jsp/releasePerform.jsp</result>
-      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
+      <result name="releaseError">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releasePerform" class="releasePerform">
@@ -620,12 +620,12 @@
         <param name="projectId">${projectId}</param>
         <param name="releaseGoal">perform</param>
       </result>
-      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
+      <result name="releaseError">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releasePerformFromScmInput" class="releasePerform" method="inputFromScm">
       <result name="success">/WEB-INF/jsp/releasePerformFromScm.jsp</result>
-      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
+      <result name="releaseError">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releasePerformFromScm" class="releasePerform" method="executeFromScm">
@@ -636,14 +636,14 @@
         <param name="releaseId">${releaseId}</param>
         <param name="releaseGoal">perform</param>
       </result>
-      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
+      <result name="releaseError">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releaseInProgress" class="releaseInProgress">
       <result name="initialized">/WEB-INF/jsp/releaseInitialized.jsp</result>
       <result name="inProgress">/WEB-INF/jsp/releaseInProgress.jsp</result>
       <result name="success">/WEB-INF/jsp/releaseFinished.jsp</result>
-      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
+      <result name="releaseError">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releaseRollbackWarning" class="releaseRollback" method="warn">
@@ -656,7 +656,7 @@
         <param name="projectId">${projectId}</param>
         <param name="releaseId">${releaseId}</param>
       </result>
-      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
+      <result name="releaseError">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releaseCleanup" class="releaseCleanup">
@@ -665,12 +665,12 @@
         <param name="actionName">projectGroupSummary</param>
         <param name="projectGroupId">${projectGroupId}</param>
       </result>
-      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
+      <result name="releaseError">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="releaseViewResult" class="releaseInProgress" method="viewResult">
       <result name="success">/WEB-INF/jsp/releaseViewResult.jsp</result>
-      <result name="error">/WEB-INF/jsp/error/releaseError.jsp</result>
+      <result name="releaseError">/WEB-INF/jsp/error/releaseError.jsp</result>
     </action>
 
     <action name="viewReleaseResult" class="releaseResult" method="viewResult">



Mime
View raw message