summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-09-14 16:25:14 +0000
committerOlivier Lamy <olamy@apache.org>2012-09-14 16:25:14 +0000
commit82b12feae91a55267fc2c7286801a30a15ebffd3 (patch)
treeb69dc46360d6bc2cf1fa0d68d87e26fa51632292 /archiva-modules/archiva-web
parente51fb8b9703d408de6a737c34b5a0d6fd7f9c3e6 (diff)
downloadarchiva-82b12feae91a55267fc2c7286801a30a15ebffd3.tar.gz
archiva-82b12feae91a55267fc2c7286801a30a15ebffd3.zip
[MRM-1664] Validation error message not visible to user when adding Remote Repository.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1384840 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web')
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java36
1 files changed, 31 insertions, 5 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java
index 9d00972aa..f19ae3201 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java
@@ -34,7 +34,7 @@ import java.util.List;
* @author Olivier Lamy
* @since 1.4-M1
*/
-@Service( "remoteRepositoriesService#rest" )
+@Service ("remoteRepositoriesService#rest")
public class DefaultRemoteRepositoriesService
extends AbstractRestService
implements RemoteRepositoriesService
@@ -53,13 +53,15 @@ public class DefaultRemoteRepositoriesService
}
catch ( RepositoryAdminException e )
{
- throw new ArchivaRestServiceException( e.getMessage(), e );
+ log.error( e.getMessage(), e );
+ throw new ArchivaRestServiceException( e.getMessage(), e.getFieldName(), e );
}
}
public RemoteRepository getRemoteRepository( String repositoryId )
throws ArchivaRestServiceException
{
+
List<RemoteRepository> remoteRepositories = getRemoteRepositories();
for ( RemoteRepository repository : remoteRepositories )
{
@@ -74,19 +76,43 @@ public class DefaultRemoteRepositoriesService
public Boolean deleteRemoteRepository( String repositoryId )
throws Exception
{
- return remoteRepositoryAdmin.deleteRemoteRepository( repositoryId, getAuditInformation() );
+ try
+ {
+ return remoteRepositoryAdmin.deleteRemoteRepository( repositoryId, getAuditInformation() );
+ }
+ catch ( RepositoryAdminException e )
+ {
+ log.error( e.getMessage(), e );
+ throw new ArchivaRestServiceException( e.getMessage(), e.getFieldName(), e );
+ }
}
public Boolean addRemoteRepository( RemoteRepository remoteRepository )
throws Exception
{
- return remoteRepositoryAdmin.addRemoteRepository( remoteRepository, getAuditInformation() );
+ try
+ {
+ return remoteRepositoryAdmin.addRemoteRepository( remoteRepository, getAuditInformation() );
+ }
+ catch ( RepositoryAdminException e )
+ {
+ log.error( e.getMessage(), e );
+ throw new ArchivaRestServiceException( e.getMessage(), e.getFieldName(), e );
+ }
}
public Boolean updateRemoteRepository( RemoteRepository remoteRepository )
throws Exception
{
- return remoteRepositoryAdmin.updateRemoteRepository( remoteRepository, getAuditInformation() );
+ try
+ {
+ return remoteRepositoryAdmin.updateRemoteRepository( remoteRepository, getAuditInformation() );
+ }
+ catch ( RepositoryAdminException e )
+ {
+ log.error( e.getMessage(), e );
+ throw new ArchivaRestServiceException( e.getMessage(), e.getFieldName(), e );
+ }
}