continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r227057 - /maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
Date Tue, 02 Aug 2005 18:19:01 GMT
Author: evenisse
Date: Tue Aug  2 11:18:40 2005
New Revision: 227057

URL: http://svn.apache.org/viewcvs?rev=227057&view=rev
Log:
Catch possible exception in irc bot

Modified:
    maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java

Modified: maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java?rev=227057&r1=227056&r2=227057&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
(original)
+++ maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
Tue Aug  2 11:18:40 2005
@@ -131,15 +131,40 @@
         // Send message
         // ----------------------------------------------------------------------
 
-        ircClient.connect( host, port, "continuum" );
+        try
+        {
+            ircClient.connect( host, port, "continuum" );
 
-        ircClient.logon();
+            ircClient.logon();
 
-        ircClient.sendMessageToChannel( channel, generateMessage( project, build ) );
-
-        ircClient.logoff();
-
-        ircClient.disconnect();
+            ircClient.sendMessageToChannel( channel, generateMessage( project, build ) );
+        }
+        catch( Exception e )
+        {
+            throw new ContinuumException( "Exception while sending message.", e );
+        }
+        finally
+        {
+            try
+            {
+                ircClient.logoff();
+            }
+            catch( Exception e )
+            {
+                throw new ContinuumException( "Exception while logoff.", e );
+            }
+            finally
+            {
+                try
+                {
+                    ircClient.disconnect();
+                }
+                catch( Exception e )
+                {
+                    throw new ContinuumException( "Exception while disconnecting.", e );
+                }
+            }
+        }
     }
 
     private String generateMessage( ContinuumProject project, ContinuumBuild build )



Mime
View raw message