wiki.techinc.nl/includes/exception
Timo Tijhof c8ca57f903 exception: Report uncaught "Catchable" fatal to "fatal" channel
Things like "Catchable fatal error: Must be X, null given" stop
execution immediately after the error handler callback, and produce
an HTTP 500 Internal Server Error page. They are very fatal.

Per <https://secure.php.net/manual/en/language.errors.php7.php>,
on PHP 7 this results in a TypeError throwable which will
eventually fatal the request and be reported through
set_exception_handler, or be caught by our top-level 'catch'
and artificially forwarded to our set_exception_handler callback.

On HHVM, these fatal error types are PHP5-like in that they
don't have a throwable object to throw yet, instead the error
meta-data is sent directly as parameeters to set_error_handler,
the same as for warnings. We need to intercept them there so
that they are reported correctly.

Sample from PHP 7:

> MediaWiki\Storage\MutableRevisionRecord::newFromParentRevision( null );
> [no req]   TypeError from line 50 of .../MutableRevisionRecord.php:
> Argument 1 passed to ...\MutableRevisionRecord::newFromParentRevision()
> must be an instance of MediaWiki\Storage\RevisionRecord, null given,
> called in /var/www/mediawiki/maintenance/eval.php(78) ...

[exit status: error(255)]

Sample from HHVM:

> MediaWiki\Storage\MutableRevisionRecord::newFromParentRevision( null );
> [hphp] set_error_handler called with:
> ...  $type = 4096 // E_RECOVERABLE_ERROR
>
> [hphp] [...] Catchable fatal error:
> Argument 1 passed to ...\MutableRevisionRecord::newFromParentRevision()
> must be an instance of MediaWiki\Storage\RevisionRecord, null given
> ...

[exit status: error(255)]

Interestingly, if you forget to return false from set_error_handler
for fatal errors on HHVM, it can actually continue execution.

Bug: T205677
Change-Id: I18dd2ff37fa2c2679d0c598cbeff0c61c2fe0253
2018-09-28 00:43:22 +00:00
..
BadRequestError.php
BadTitleError.php
CannotCreateActorException.php Add actor table and code to start using it 2018-02-23 10:06:20 -08:00
ErrorPageError.php
FatalError.php
HttpError.php
LocalizedException.php Fix PhanTypeMismatchDeclaredParam 2018-07-07 00:34:30 +00:00
MWContentSerializationException.php
MWException.php exception: Avoid preg_replace for literal swap 2018-09-27 17:39:42 +01:00
MWExceptionHandler.php exception: Report uncaught "Catchable" fatal to "fatal" channel 2018-09-28 00:43:22 +00:00
MWExceptionRenderer.php exception: Avoid preg_replace for literal swap 2018-09-27 17:39:42 +01:00
MWUnknownContentModelException.php
PermissionsError.php
ProcOpenError.php Replace wfShellExec() with a class 2017-09-08 21:49:49 -07:00
ReadOnlyError.php
ShellDisabledError.php Replace wfShellExec() with a class 2017-09-08 21:49:49 -07:00
ThrottledError.php
UserBlockedError.php
UserNotLoggedIn.php