From: Mikael Nordfeldth Date: Sat, 3 Oct 2015 10:33:33 +0000 (+0200) Subject: Somewhat better logging while still in trial phase X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1244e8d9297de2675ac3977907f6dfebf2863c9a;p=quix0rs-gnu-social.git Somewhat better logging while still in trial phase --- diff --git a/plugins/ActivityModeration/ActivityModerationPlugin.php b/plugins/ActivityModeration/ActivityModerationPlugin.php index 4422310e58..64e065d305 100644 --- a/plugins/ActivityModeration/ActivityModerationPlugin.php +++ b/plugins/ActivityModeration/ActivityModerationPlugin.php @@ -89,8 +89,8 @@ class ActivityModerationPlugin extends ActivityVerbHandlerPlugin return $deleted; } - common_debug('DELETING notice: ' . $act->objects[0]->id); $target = Notice::getByUri($act->objects[0]->id); + common_debug('DELETING notice: ' . $act->objects[0]->id . ' on behalf of profile id==' . $target->getProfile()->getID()); $deleted = new Deleted_notice(); @@ -101,8 +101,10 @@ class ActivityModerationPlugin extends ActivityVerbHandlerPlugin $deleted->act_created = $target->created; $deleted->created = common_sql_now(); - common_debug('DELETING notice, storing Deleted_notice entry'); - $deleted->insert(); + $result = $deleted->insert(); + if ($result === false) { + throw new ServerException('Could not insert Deleted_notice entry into database!'); + } common_debug('DELETING notice, actually deleting now!'); $target->delete();