summaryrefslogtreecommitdiff
path: root/lib/servererroraction.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-22 11:33:56 -0700
committerBrion Vibber <brion@pobox.com>2010-03-22 11:33:56 -0700
commit4168b9cec1f7b2e6421c018e56e3b9a13c14d581 (patch)
tree17444dd9d6191d93b422d1cd53b67d11ed72ba97 /lib/servererroraction.php
parent3bb639699c7a5e7e96c0d048adbe48a3ed486fc9 (diff)
Log backtraces for non-ClientException exceptions caught at the top-level handler.
Diffstat (limited to 'lib/servererroraction.php')
-rw-r--r--lib/servererroraction.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/servererroraction.php b/lib/servererroraction.php
index 0993a63bc..9b5a553dc 100644
--- a/lib/servererroraction.php
+++ b/lib/servererroraction.php
@@ -62,15 +62,18 @@ class ServerErrorAction extends ErrorAction
504 => 'Gateway Timeout',
505 => 'HTTP Version Not Supported');
- function __construct($message='Error', $code=500)
+ function __construct($message='Error', $code=500, $ex=null)
{
parent::__construct($message, $code);
$this->default = 500;
// Server errors must be logged.
-
- common_log(LOG_ERR, "ServerErrorAction: $code $message");
+ $log = "ServerErrorAction: $code $message";
+ if ($ex) {
+ $log .= "\n" . $ex->getTraceAsString();
+ }
+ common_log(LOG_ERR, $log);
}
// XXX: Should these error actions even be invokable via URI?