From 3471213d1c9921a6433678edc2f4ca0113a73287 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Tue, 5 Jan 2016 15:00:07 +0100 Subject: [PATCH] processFeed would abort on certain errors where findLocalObject failed --- plugins/Favorite/classes/Fave.php | 2 ++ plugins/OStatus/classes/Ostatus_profile.php | 3 +++ 2 files changed, 5 insertions(+) diff --git a/plugins/Favorite/classes/Fave.php b/plugins/Favorite/classes/Fave.php index 66d5a186d8..a5acb66d20 100644 --- a/plugins/Favorite/classes/Fave.php +++ b/plugins/Favorite/classes/Fave.php @@ -353,6 +353,8 @@ class Fave extends Managed_DataObject */ static public function parseActivityObject(ActivityObject $actobj, Notice $stored) { + // throws exception if nothing was found, but it could also be a non-Notice... + // FIXME: This should only test _one_ URI (and not the links etc.) though a function like this could be useful in other cases $local = ActivityUtils::findLocalObject($actobj->getIdentifiers()); if (!$local instanceof Notice) { // $local always returns something, but this was not what we expected. Something is wrong. diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 00c87bb004..e35cfe4357 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -473,6 +473,9 @@ class Ostatus_profile extends Managed_DataObject $this->processEntry($entry, $feed, $source); } catch (AlreadyFulfilledException $e) { common_debug('We already had this entry: '.$e->getMessage()); + } catch (ServerException $e) { + // FIXME: This should be UnknownUriException and the ActivityUtils:: findLocalObject should only test one URI + common_log(LOG_ERR, 'Entry threw exception while processing a feed from '.$source.': '.$e->getMessage()); } } } -- 2.39.5