]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
ActivityImporter catches thrown exceptions by plugins and marks entry done
authorEvan Prodromou <evan@status.net>
Mon, 30 May 2011 13:57:49 +0000 (09:57 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 30 May 2011 13:57:49 +0000 (09:57 -0400)
lib/activityimporter.php

index b1f30fa4bffe21510a339d251c126080439de3a9..b5c83516ec0fd26296c89e2ff9ecc8269a56f625 100644 (file)
@@ -63,9 +63,9 @@ class ActivityImporter extends QueueHandler
 
         $done = null;
 
-        if (Event::handle('StartImportActivity',
-                          array($user, $author, $activity, $trusted, &$done))) {
-            try {
+        try {
+            if (Event::handle('StartImportActivity',
+                              array($user, $author, $activity, $trusted, &$done))) {
                 switch ($activity->verb) {
                 case ActivityVerb::FOLLOW:
                     $this->subscribeProfile($user, $author, $activity);
@@ -83,10 +83,10 @@ class ActivityImporter extends QueueHandler
                 Event::handle('EndImportActivity',
                               array($user, $author, $activity, $trusted));
                 $done = true;
-            } catch (Exception $e) {
-                common_log(LOG_ERR, $e->getMessage());
-                $done = true;
             }
+        } catch (Exception $e) {
+            common_log(LOG_ERR, $e->getMessage());
+            $done = true;
         }
         return $done;
     }