Page MenuHomePhabricator

D18300.diff
No OneTemporary

D18300.diff

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);
+ }
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 7:47 AM (13 h, 24 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6913220
Default Alt Text
D18300.diff (2 KB)

Event Timeline