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:
Bartosz Dziewoński 2020-11-02 21:31:37 +01:00
parent e18a0f3dcd
commit 885d05b57b

View file

@ -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 );