Path: blob/master/src/aphront/handler/PhabricatorAjaxRequestExceptionHandler.php
12241 views
<?php12final class PhabricatorAjaxRequestExceptionHandler3extends PhabricatorRequestExceptionHandler {45public function getRequestExceptionHandlerPriority() {6return 110000;7}89public function getRequestExceptionHandlerDescription() {10return pht('Responds to requests made by AJAX clients.');11}1213public function canHandleRequestThrowable(14AphrontRequest $request,15$throwable) {16// For non-workflow requests, return a Ajax response.17return ($request->isAjax() && !$request->isWorkflow());18}1920public function handleRequestThrowable(21AphrontRequest $request,22$throwable) {2324// Log these; they don't get shown on the client and can be difficult25// to debug.26phlog($throwable);2728$response = new AphrontAjaxResponse();29$response->setError(30array(31'code' => get_class($throwable),32'info' => $throwable->getMessage(),33));3435return $response;36}3738}394041