mirror of https://github.com/apache/archiva.git
[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
This commit is contained in:
parent
e51fb8b970
commit
82b12feae9
|
@ -34,7 +34,7 @@ import java.util.List;
|
||||||
* @author Olivier Lamy
|
* @author Olivier Lamy
|
||||||
* @since 1.4-M1
|
* @since 1.4-M1
|
||||||
*/
|
*/
|
||||||
@Service( "remoteRepositoriesService#rest" )
|
@Service ("remoteRepositoriesService#rest")
|
||||||
public class DefaultRemoteRepositoriesService
|
public class DefaultRemoteRepositoriesService
|
||||||
extends AbstractRestService
|
extends AbstractRestService
|
||||||
implements RemoteRepositoriesService
|
implements RemoteRepositoriesService
|
||||||
|
@ -53,13 +53,15 @@ public class DefaultRemoteRepositoriesService
|
||||||
}
|
}
|
||||||
catch ( RepositoryAdminException e )
|
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 )
|
public RemoteRepository getRemoteRepository( String repositoryId )
|
||||||
throws ArchivaRestServiceException
|
throws ArchivaRestServiceException
|
||||||
{
|
{
|
||||||
|
|
||||||
List<RemoteRepository> remoteRepositories = getRemoteRepositories();
|
List<RemoteRepository> remoteRepositories = getRemoteRepositories();
|
||||||
for ( RemoteRepository repository : remoteRepositories )
|
for ( RemoteRepository repository : remoteRepositories )
|
||||||
{
|
{
|
||||||
|
@ -74,19 +76,43 @@ public class DefaultRemoteRepositoriesService
|
||||||
public Boolean deleteRemoteRepository( String repositoryId )
|
public Boolean deleteRemoteRepository( String repositoryId )
|
||||||
throws Exception
|
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 )
|
public Boolean addRemoteRepository( RemoteRepository remoteRepository )
|
||||||
throws Exception
|
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 )
|
public Boolean updateRemoteRepository( RemoteRepository remoteRepository )
|
||||||
throws Exception
|
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 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue