Path: blob/master/src/aphront/handler/PhabricatorConduitRequestExceptionHandler.php
12241 views
<?php12final class PhabricatorConduitRequestExceptionHandler3extends PhabricatorRequestExceptionHandler {45public function getRequestExceptionHandlerPriority() {6return 100000;7}89public function getRequestExceptionHandlerDescription() {10return pht('Responds to requests made by Conduit clients.');11}1213public function canHandleRequestThrowable(14AphrontRequest $request,15$throwable) {16return $request->isConduit();17}1819public function handleRequestThrowable(20AphrontRequest $request,21$throwable) {2223$response = id(new ConduitAPIResponse())24->setErrorCode(get_class($throwable))25->setErrorInfo($throwable->getMessage());2627return id(new AphrontJSONResponse())28->setAddJSONShield(false)29->setContent($response->toDictionary());30}3132}333435