1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00
phorge-phorge/support/startup
epriestley b9a1260ef5 Improve top-level fatal exception handling in PHP 7+
Summary:
Depends on D20137. Ref T13250. Ref T12101. In versions of PHP beyond 7, various engine errors are gradually changing from internal fatals or internal errors to `Throwables`, a superclass of `Exception`.

This is generally a good change, but code written against PHP 5.x before `Throwable` was introduced may not catch these errors, even when the code is intended to be a top-level exception handler.

(The double-catch pattern here and elsewhere is because `Throwable` does not exist in older PHP, so `catch (Throwable $ex)` catches nothing. The `Exception $ex` clause catches everything in old PHP, the `Throwable $ex` clause catches everything in newer PHP.)

Generalize some `Exception` into `Throwable`.

Test Plan:
  - Added a bogus function call to the rendering stack.
  - Before change: got a blank page.
  - After change: nice exception page.

{F6205012}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13250, T12101

Differential Revision: https://secure.phabricator.com/D20138
2019-02-11 15:05:15 -08:00
..
PhabricatorClientConnectionLimit.php Modularize rate/connection limits in Phabricator 2017-10-13 13:12:05 -07:00
PhabricatorClientLimit.php Modularize rate/connection limits in Phabricator 2017-10-13 13:12:05 -07:00
PhabricatorClientRateLimit.php Tweak rate limiting point counts for omnipotent users 2017-10-16 06:43:54 -07:00
PhabricatorStartup.php Improve top-level fatal exception handling in PHP 7+ 2019-02-11 15:05:15 -08:00