1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 12:30:56 +01:00
phorge-phorge/src/aphront
epriestley 00bb0c9071 Raise setup warnings immediately when failing to load configuration from the database
Summary:
Ref T11589. Previously, when we failed to load database configuration we just continued anyway, in order to get to setup checks so we could raise a better error.

There was a small chance that this could lead to pages running in a broken state, where ONLY that connection failed and everything else worked. This was accidentally fixed by narrowing the exceptions we continue on in D16489.

However, this "fix" meant that users no longer got helpful setup instructions. Instead:

  - Keep throwing these exceptions: it's bad to continue if we've failed to connect to the database.
  - However, catch them and turn them into setup errors.
  - Share all the setup code so these errors and setup check errors work the same way.

Test Plan:
  - Intentionally broke `mysql.host` and `mysql.pass`.
  - Loaded pages.
  - Got good setup errors.
  - Hit normal setup errors too.
  - Put everything back.
  - Swapped into cluster mode.
  - Intentionally broke cluster mode, saw failover to readonly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11589

Differential Revision: https://secure.phabricator.com/D16501
2016-09-06 14:20:31 -07:00
..
__tests__ phtize all the things 2015-05-22 21:16:39 +10:00
configuration Raise setup warnings immediately when failing to load configuration from the database 2016-09-06 14:20:31 -07:00
exception Convert some whiny exceptions into quiet MalformedRequest exceptions 2016-08-16 15:50:21 -07:00
handler Convert some whiny exceptions into quiet MalformedRequest exceptions 2016-08-16 15:50:21 -07:00
httpparametertype Smooth over a few more transaction compatibility/structure issues with Calendar events 2016-07-13 07:44:15 -07:00
interface Allow Controllers to return a wider range of "response-like" objects 2015-09-01 15:52:52 -07:00
response Use phutil_json_encode() in AphrontResponse to raise better errors 2016-08-26 07:39:22 -07:00
sink Extend from Phobject 2015-06-15 18:02:27 +10:00
site Don't apply security.require-https to intracluster requests 2016-04-13 12:51:41 -07:00
AphrontController.php Provide an AphrontController implementation of willSendResponse() 2015-09-07 17:18:35 -07:00
AphrontRequest.php Convert some whiny exceptions into quiet MalformedRequest exceptions 2016-08-16 15:50:21 -07:00