@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at upstream/main 32 lines 917 B view raw
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 */ 11abstract class AphrontRequestExceptionHandler extends Phobject { 12 13 abstract public function getRequestExceptionHandlerDescription(); 14 15 abstract public function getRequestExceptionHandlerPriority(); 16 17 abstract public function canHandleRequestThrowable( 18 AphrontRequest $request, 19 $throwable); 20 21 abstract public function handleRequestThrowable( 22 AphrontRequest $request, 23 $throwable); 24 25 final public static function getAllHandlers() { 26 return id(new PhutilClassMapQuery()) 27 ->setAncestorClass(self::class) 28 ->setSortMethod('getRequestExceptionHandlerPriority') 29 ->execute(); 30 } 31 32}