roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r559889 - /roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/updater/SingleThreadedFeedUpdater.java
Date Thu, 26 Jul 2007 17:16:53 GMT
Author: agilliland
Date: Thu Jul 26 10:16:52 2007
New Revision: 559889

URL: http://svn.apache.org/viewvc?view=rev&rev=559889
Log:
prevent a potential null pointer when the updatedSub doesn't have a last updated time.  also
adding in some better log handling so that failed subscription updates don't result in really
long 4 exception stack traces.

Modified:
    roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/updater/SingleThreadedFeedUpdater.java

Modified: roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/updater/SingleThreadedFeedUpdater.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/updater/SingleThreadedFeedUpdater.java?view=diff&rev=559889&r1=559888&r2=559889
==============================================================================
--- roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/updater/SingleThreadedFeedUpdater.java
(original)
+++ roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/updater/SingleThreadedFeedUpdater.java
Thu Jul 26 10:16:52 2007
@@ -77,7 +77,7 @@
         }
         
         // if this subscription hasn't changed since last update then we're done
-        if(sub.getLastUpdated() != null &&
+        if(sub.getLastUpdated() != null && updatedSub.getLastUpdated() != null &&
                 !updatedSub.getLastUpdated().after(sub.getLastUpdated())) {
             log.debug("Skipping update, feed hasn't changed - "+sub.getFeedURL());
         }
@@ -183,6 +183,15 @@
             // this updates and saves
             try {
                 updateSubscription(sub);
+            } catch(UpdaterException ex) {
+                // do a little work to get at the source of the problem
+                Throwable cause = ex.getCause();
+                if(cause.getCause() != null) {
+                    cause = cause.getCause();
+                }
+                
+                log.warn("Error updating subscription - "+sub.getFeedURL(), cause);
+                
             } catch(Exception ex) {
                 log.warn("Error updating subscription - "+sub.getFeedURL(), ex);
             }



Mime
View raw message