diff --git a/src/aphront/handler/PhabricatorAjaxRequestExceptionHandler.php b/src/aphront/handler/PhabricatorAjaxRequestExceptionHandler.php --- a/src/aphront/handler/PhabricatorAjaxRequestExceptionHandler.php +++ b/src/aphront/handler/PhabricatorAjaxRequestExceptionHandler.php @@ -18,13 +18,8 @@ return ($request->isAjax() && !$request->isWorkflow()); } - public function handleRequestThrowable( - AphrontRequest $request, - $throwable) { - - // Log these; they don't get shown on the client and can be difficult - // to debug. - phlog($throwable); + public function handleRequestThrowable(AphrontRequest $request, $throwable) { + parent::handleRequestThrowable($request, $throwable); $response = new AphrontAjaxResponse(); $response->setError( diff --git a/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php b/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php --- a/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php +++ b/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php @@ -22,27 +22,12 @@ return true; } - public function handleRequestThrowable( - AphrontRequest $request, - $throwable) { - - $viewer = $this->getViewer($request); - - // Some types of uninteresting request exceptions don't get logged, usually - // because they are caused by the background radiation of bot traffic on - // the internet. These include requests with bad CSRF tokens and - // questionable "Host" headers. - $should_log = true; - if ($throwable instanceof AphrontMalformedRequestException) { - $should_log = !$throwable->getIsUnlogged(); - } - - if ($should_log) { - phlog($throwable); - } + public function handleRequestThrowable(AphrontRequest $request, $throwable) { + parent::handleRequestThrowable($request, $throwable); $class = get_class($throwable); $message = $throwable->getMessage(); + $viewer = $this->getViewer($request); if ($throwable instanceof AphrontSchemaQueryException) { $message .= "\n\n".pht( diff --git a/src/aphront/handler/PhabricatorRequestExceptionHandler.php b/src/aphront/handler/PhabricatorRequestExceptionHandler.php --- a/src/aphront/handler/PhabricatorRequestExceptionHandler.php +++ b/src/aphront/handler/PhabricatorRequestExceptionHandler.php @@ -23,4 +23,20 @@ return new PhabricatorUser(); } + public function handleRequestThrowable(AphrontRequest $request, $throwable) { + // Some types of uninteresting request exceptions don't get logged, usually + // because they are caused by the background radiation of bot traffic on + // the internet. These include requests with bad CSRF tokens and + // questionable "Host" headers. + $should_log = true; + + if ($throwable instanceof AphrontMalformedRequestException) { + $should_log = !$throwable->getIsUnlogged(); + } + + if ($should_log) { + phlog($throwable); + } + } + }