Enhance stacktrace logging for fatals
authorBryan Davis <bd808@wikimedia.org>
Tue, 25 Aug 2015 04:36:30 +0000 (22:36 -0600)
committerGergő Tisza <gtisza@wikimedia.org>
Tue, 8 Sep 2015 07:03:36 +0000 (07:03 +0000)
commita6016137e80e4623d1874620ac936d0703b4534f
treefbb1aa1ea493af40ed237db96db5af2d791bbc3c
parentbe5cc8d84656ab2e536a3b51f3d1656beb19e8d3
Enhance stacktrace logging for fatals

Split fatal error handling out of MWExceptionHandler::handleError() and
move to MWExceptionHandler::handleFatalError() which has been updated to
work as a dual purpose error handler and shutdown function. Under HHVM
it will be called as an error handler and receive a stacktrace via an
undocumented extension of the error handler callback data. Under PHP5 it
will be called as a shutdown handler and attempt to gather data via
error_get_last().

Also update the error handler installed by Hooks::run() to delegate to
MWExceptionHandler::handleError() for most errors. This will allow us to
properly handle errors raised from within hooks.

Bug: T89169
Change-Id: I0f1c66f203b91fff9069520169ecc4a3b55c43d0
includes/Hooks.php
includes/exception/MWExceptionHandler.php