Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/aphront/handler/AphrontRequestExceptionHandler.php
12241 views
1
<?php
2
3
/**
4
* React to an unhandled exception escaping request handling in a controller
5
* and convert it into a response.
6
*
7
* These handlers are generally used to render error pages, but they may
8
* also perform more specialized handling in situations where an error page
9
* is not appropriate.
10
*/
11
abstract class AphrontRequestExceptionHandler extends Phobject {
12
13
abstract public function getRequestExceptionHandlerPriority();
14
15
abstract public function canHandleRequestThrowable(
16
AphrontRequest $request,
17
$throwable);
18
19
abstract public function handleRequestThrowable(
20
AphrontRequest $request,
21
$throwable);
22
23
final public static function getAllHandlers() {
24
return id(new PhutilClassMapQuery())
25
->setAncestorClass(__CLASS__)
26
->setSortMethod('getRequestExceptionHandlerPriority')
27
->execute();
28
}
29
30
}
31
32