mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Add try…catch in failing deferred update
This code is throwing exception for as yet uncertain reasons, which may cause other updates to not be executed (e.g. Echo notifications). Put a try…catch around it while we investigate. Bug: T315383 Change-Id: Ic7aba32369f69c2e8165d5d6d25687a4cb6e0be8
This commit is contained in:
parent
38ff32c0e7
commit
ee4e75cbf5
|
@ -14,6 +14,8 @@ use MediaWiki\Extension\DiscussionTools\ThreadItemStore;
|
|||
use MediaWiki\Revision\RenderedRevision;
|
||||
use MediaWiki\Storage\Hook\RevisionDataUpdatesHook;
|
||||
use MWCallableUpdate;
|
||||
use MWExceptionHandler;
|
||||
use Throwable;
|
||||
use Title;
|
||||
|
||||
class DataUpdatesHooks implements RevisionDataUpdatesHook {
|
||||
|
@ -44,8 +46,13 @@ class DataUpdatesHooks implements RevisionDataUpdatesHook {
|
|||
$rev = $renderedRevision->getRevision();
|
||||
if ( HookUtils::isAvailableForTitle( $title ) ) {
|
||||
$updates[] = new MWCallableUpdate( function () use ( $rev ) {
|
||||
try {
|
||||
$threadItemSet = HookUtils::parseRevisionParsoidHtml( $rev );
|
||||
$this->threadItemStore->insertThreadItems( $rev, $threadItemSet );
|
||||
} catch ( Throwable $e ) {
|
||||
// Catch errors, so that they don't cause other updates to fail (T315383), but log them.
|
||||
MWExceptionHandler::logException( $e );
|
||||
}
|
||||
}, __METHOD__ );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue