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();
$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();