Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / infrastructure / cluster / exception / PhabricatorClusterExceptionHandler.php
blobed0e0cc605e3c1bc5df064627b90189b1442fc4a
1 <?php
3 final class PhabricatorClusterExceptionHandler
4 extends PhabricatorRequestExceptionHandler {
6 public function getRequestExceptionHandlerPriority() {
7 return 300000;
10 public function getRequestExceptionHandlerDescription() {
11 return pht('Handles runtime problems with cluster configuration.');
14 public function canHandleRequestThrowable(
15 AphrontRequest $request,
16 $throwable) {
17 return ($throwable instanceof PhabricatorClusterException);
20 public function handleRequestThrowable(
21 AphrontRequest $request,
22 $throwable) {
24 $viewer = $this->getViewer($request);
26 $title = $throwable->getExceptionTitle();
28 $dialog = id(new AphrontDialogView())
29 ->setTitle($title)
30 ->setUser($viewer)
31 ->appendParagraph($throwable->getMessage())
32 ->addCancelButton('/', pht('Proceed With Caution'));
34 return id(new AphrontDialogResponse())
35 ->setDialog($dialog)
36 ->setHTTPResponseCode(500);