isPhabricatorSite($request)) { return false; } return ($ex instanceof PhabricatorSystemActionRateLimitException); } public function handleRequestException( AphrontRequest $request, Exception $ex) { $viewer = $this->getViewer($request); return id(new AphrontDialogView()) ->setTitle(pht('Slow Down!')) ->setUser($viewer) ->setErrors(array(pht('You are being rate limited.'))) ->appendParagraph($ex->getMessage()) ->appendParagraph($ex->getRateExplanation()) ->addCancelButton('/', pht('Okaaaaaaaaaaaaaay...')); } }