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