You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2005/12/01 16:49:31 UTC

svn commit: r350264 - in /incubator/roller/trunk/src/org/roller/presentation: BlacklistUpdateTask.java TurnoverReferersTask.java

Author: snoopdave
Date: Thu Dec  1 07:49:26 2005
New Revision: 350264

URL: http://svn.apache.org/viewcvs?rev=350264&view=rev
Log:
Consistent use of try-catch and exit in command-line tasks

Modified:
    incubator/roller/trunk/src/org/roller/presentation/BlacklistUpdateTask.java
    incubator/roller/trunk/src/org/roller/presentation/TurnoverReferersTask.java

Modified: incubator/roller/trunk/src/org/roller/presentation/BlacklistUpdateTask.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/BlacklistUpdateTask.java?rev=350264&r1=350263&r2=350264&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/BlacklistUpdateTask.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/BlacklistUpdateTask.java Thu Dec  1 07:49:26 2005
@@ -47,12 +47,17 @@
      * Main method so that this task may be run from outside the webapp.
      */
     public static void main(String[] args) throws Exception {
-        
-        // NOTE: if this task is run externally from the Roller webapp then
-        // all it will really be doing is downloading the MT blacklist file
-        BlacklistUpdateTask task = new BlacklistUpdateTask();
-        task.init(null, null);
-        task.run();
+        try {            
+            // NOTE: if this task is run externally from the Roller webapp then
+            // all it will really be doing is downloading the MT blacklist file
+            BlacklistUpdateTask task = new BlacklistUpdateTask();
+            task.init(null, null);
+            task.run();
+            System.exit(0);
+        } catch (RollerException ex) {
+            ex.printStackTrace();
+            System.exit(-1);
+        }
     }
     
 }

Modified: incubator/roller/trunk/src/org/roller/presentation/TurnoverReferersTask.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/TurnoverReferersTask.java?rev=350264&r1=350263&r2=350264&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/TurnoverReferersTask.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/TurnoverReferersTask.java Thu Dec  1 07:49:26 2005
@@ -62,10 +62,15 @@
      * Main method so that this task may be run from outside the webapp.
      */
     public static void main(String[] args) throws Exception {
-        
-        TurnoverReferersTask task = new TurnoverReferersTask();
-        task.init(null, null);
-        task.run();
+        try {            
+            TurnoverReferersTask task = new TurnoverReferersTask();
+            task.init(null, null);
+            task.run();
+            System.exit(0);
+        } catch (RollerException ex) {
+            ex.printStackTrace();
+            System.exit(-1);
+        }
     }
     
 }