continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From batkin...@apache.org
Subject svn commit: r1660691 - in /continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java resources/localization/Continuum.properties
Date Wed, 18 Feb 2015 17:39:05 GMT
Author: batkinson
Date: Wed Feb 18 17:39:05 2015
New Revision: 1660691

URL: http://svn.apache.org/r1660691
Log:
Show user-friendly message when failing to save config.

Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java?rev=1660691&r1=1660690&r2=1660691&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
Wed Feb 18 17:39:05 2015
@@ -24,7 +24,6 @@ import org.apache.continuum.configuratio
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.configuration.ConfigurationStoringException;
 import org.apache.maven.continuum.security.ContinuumRoleConstants;
-import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.web.action.ContinuumActionSupport;
 import org.apache.struts2.ServletActionContext;
 import org.codehaus.plexus.component.annotations.Component;
@@ -140,7 +139,7 @@ public class ConfigurationAction
     }
 
     public String save()
-        throws ConfigurationStoringException, ContinuumStoreException, ContinuumConfigurationException
+        throws ConfigurationStoringException
     {
         if ( numberOfAllowedBuildsinParallel <= 0 )
         {
@@ -187,7 +186,16 @@ public class ConfigurationAction
 
         configuration.setSharedSecretPassword( sharedSecretPassword );
 
-        configuration.store();
+        try
+        {
+            configuration.store();
+        }
+        catch ( ContinuumConfigurationException cce )
+        {
+            log.error( "failed to save configuration", cce );
+            addActionError( getText( "configuration.save.failed" ) );
+            return INPUT;
+        }
 
         return SUCCESS;
     }

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=1660691&r1=1660690&r2=1660691&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Wed Feb 18 17:39:05 2015
@@ -283,6 +283,7 @@ configuration.sharedSecretPassword.label
 configuration.sharedSecretPassword.message = Enter the shared secret password between master
and agents when distributed build is enabled
 configuration.dir.notdir=Location not a directory
 configuration.dir.notwritable=Directory not writable
+configuration.save.failed=Failed to save configuration file
 
 # ----------------------------------------------------------------------
 # Page: Add Project



Mime
View raw message