Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/infrastructure/cluster/exception/PhabricatorClusterExceptionHandler.php
12241 views
1
<?php
2
3
final class PhabricatorClusterExceptionHandler
4
extends PhabricatorRequestExceptionHandler {
5
6
public function getRequestExceptionHandlerPriority() {
7
return 300000;
8
}
9
10
public function getRequestExceptionHandlerDescription() {
11
return pht('Handles runtime problems with cluster configuration.');
12
}
13
14
public function canHandleRequestThrowable(
15
AphrontRequest $request,
16
$throwable) {
17
return ($throwable instanceof PhabricatorClusterException);
18
}
19
20
public function handleRequestThrowable(
21
AphrontRequest $request,
22
$throwable) {
23
24
$viewer = $this->getViewer($request);
25
26
$title = $throwable->getExceptionTitle();
27
28
$dialog = id(new AphrontDialogView())
29
->setTitle($title)
30
->setUser($viewer)
31
->appendParagraph($throwable->getMessage())
32
->addCancelButton('/', pht('Proceed With Caution'));
33
34
return id(new AphrontDialogResponse())
35
->setDialog($dialog)
36
->setHTTPResponseCode(500);
37
}
38
39
}
40
41