mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 16:34:21 +00:00
Handle any errors, not just exceptions
Internal PHP errors (such as "Call to undefined method…") are not Exceptions.
Follow-up to e18a0f3dcd
.
Bug: T267035
Change-Id: I3cbf2b6b0d1d8a97cdac9791ec4f7b2ec807c7e5
This commit is contained in:
parent
e18a0f3dcd
commit
885d05b57b
|
@ -11,13 +11,13 @@ namespace MediaWiki\Extension\DiscussionTools;
|
|||
|
||||
use Action;
|
||||
use ConfigException;
|
||||
use Exception;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MWExceptionHandler;
|
||||
use OutputPage;
|
||||
use RecentChange;
|
||||
use RequestContext;
|
||||
use Skin;
|
||||
use Throwable;
|
||||
use User;
|
||||
use VisualEditorHooks;
|
||||
use WebRequest;
|
||||
|
@ -182,8 +182,8 @@ class Hooks {
|
|||
$formatter->addReplyLinks();
|
||||
$newText = $formatter->getText();
|
||||
|
||||
} catch ( Exception $e ) {
|
||||
// Catch exceptions, so that they don't cause the entire page to not display.
|
||||
} catch ( Throwable $e ) {
|
||||
// Catch errors, so that they don't cause the entire page to not display.
|
||||
// Log it and add the request ID in a comment to make it easier to find in the logs.
|
||||
MWExceptionHandler::logException( $e );
|
||||
|
||||
|
|
Loading…
Reference in a new issue