forked from GNUsocial/gnu-social
Distinguish notice saving errors from others for Salmon
This commit is contained in:
parent
4678546d33
commit
deda83fdef
@ -950,7 +950,7 @@ class Notice extends Managed_DataObject
|
||||
$object = null;
|
||||
Event::handle('StoreActivityObject', array($act, $stored, $options, &$object));
|
||||
if (empty($object)) {
|
||||
throw new ServerException('Unsuccessful call to StoreActivityObject '.$stored->getUri() . ': '.$act->asString());
|
||||
throw new NoticeSaveException('Unsuccessful call to StoreActivityObject '._ve($stored->getUri()) . ': '._ve($act->asString()));
|
||||
}
|
||||
|
||||
// If something changed in the Notice during StoreActivityObject
|
||||
|
17
lib/noticesaveexception.php
Normal file
17
lib/noticesaveexception.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
if (!defined('GNUSOCIAL')) { exit(1); }
|
||||
|
||||
/**
|
||||
* Base exception class for when a notice cannot be saved
|
||||
*
|
||||
* @category Exception
|
||||
* @package GNUsocial
|
||||
* @author Mikael Nordfeldth <mmn@hethane.se>
|
||||
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||
* @link https://gnu.io/social
|
||||
*/
|
||||
|
||||
class NoticeSaveException extends ServerException
|
||||
{
|
||||
}
|
@ -109,6 +109,8 @@ class SalmonAction extends Action
|
||||
// duplicate? Maybe someone's database is out of sync?
|
||||
// Let's just accept it and move on.
|
||||
common_log(LOG_INFO, 'Salmon slap carried an event which had already been fulfilled.');
|
||||
} catch (NoticeSaveException $e) {
|
||||
common_debug('Notice::saveActivity did not save our '._ve($this->activity->verb).' activity, trying old-fashioned salmon saving.');
|
||||
}
|
||||
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user