Fixed XF::dispatchLoop swallows Throwables from triggerRunOnce()

Xon

Well-known member
Licensed customer
Affected version
2.3.12
If triggerRunOnce() throws a Error (aka a Throwable not an Exception) then XF::dispatchLoop will swallow it.

PHP:
public static function triggerRunOnce($rethrow = false)
{
...
try
{
    $fn();
}
catch (\Exception $e)
{
    self::logException($e, true);
    // can't know if we have an open transaction from before so have to roll it back

    if ($rethrow)
    {
        throw $e;
    }
}
...
public function dispatchLoop(RouteMatch $match)
{
...
try
{
    \XF::triggerRunOnce(true);
}
catch (\Throwable $e)
{
...
}
 
This is more noticeable recently as recent version of php start throwing more Errors for thing which XF used to turn into an ErrorException
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.14).

Change log:
Log PHP errors from deferred tasks to the server error log instead of losing them
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom