archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r629311 - /maven/archiva/tools/trunk/maven-meeper/src/main/java/org/apache/maven/archiva/meeper/Synchronizer.java
Date Wed, 20 Feb 2008 01:51:14 GMT
Author: carlos
Date: Tue Feb 19 17:50:55 2008
New Revision: 629311

URL: http://svn.apache.org/viewvc?rev=629311&view=rev
Log:
Log exceptions and write a better email

Modified:
    maven/archiva/tools/trunk/maven-meeper/src/main/java/org/apache/maven/archiva/meeper/Synchronizer.java

Modified: maven/archiva/tools/trunk/maven-meeper/src/main/java/org/apache/maven/archiva/meeper/Synchronizer.java
URL: http://svn.apache.org/viewvc/maven/archiva/tools/trunk/maven-meeper/src/main/java/org/apache/maven/archiva/meeper/Synchronizer.java?rev=629311&r1=629310&r2=629311&view=diff
==============================================================================
--- maven/archiva/tools/trunk/maven-meeper/src/main/java/org/apache/maven/archiva/meeper/Synchronizer.java
(original)
+++ maven/archiva/tools/trunk/maven-meeper/src/main/java/org/apache/maven/archiva/meeper/Synchronizer.java
Tue Feb 19 17:50:55 2008
@@ -53,16 +53,17 @@
             {
                 System.out.println( "Error synchronizing repository " + repo.getGroupId()
+ ". " + e.getMessage() );
                 failedRepositories.add( repo );
-            }
-            catch ( InterruptedException e )
-            {
-                System.out.println( "Repository sync for " + repo.getGroupId() + " was interrupted"
);
+                Throwable cause = e;
+                while ( cause != null )
+                {
+                    repo.getErr().append( cause.getMessage() );
+                    cause = cause.getCause();
+                }
             }
         }
     }
 
     public void sync( SyncedRepository repo )
-        throws InterruptedException
     {
         /* update from svn if necessary */
         if ( SyncedRepository.PROTOCOL_SVN.equals( repo.getProtocol() ) )
@@ -91,7 +92,6 @@
     }
 
     private int syncMetadata( SyncedRepository repo )
-        throws InterruptedException
     {
         Commandline cl = new Commandline();
         cl.setExecutable( RSYNC );
@@ -236,12 +236,14 @@
         {
             StringBuffer sb = new StringBuffer();
             sb.append( "--- Some repositories were not synchronized ---" );
+            sb.append( "\n" );
             Iterator it = synchronizer.failedRepositories.iterator();
             while ( it.hasNext() )
             {
                 SyncedRepository repo = (SyncedRepository) it.next();
+                sb.append( "groupId: " );
                 sb.append( repo.getGroupId() );
-                sb.append( "\n" );
+                sb.append( "\nError:\n" );
                 sb.append( repo.getErr() );
                 sb.append( "\n" );
                 sb.append( "\n" );
@@ -249,9 +251,11 @@
             synchronizer.sendEmail( "FAILURE", sb.toString() );
         }
 
-        /* send email out */
     }
 
+    /**
+     * send email out
+     */
     private void sendEmail( String subject, String text )
     {
         SimpleEmail email = new SimpleEmail();



Mime
View raw message