From 1dbeb12332ae24ea782b557636fff0cc59805f12 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 11 Apr 2012 20:29:38 +0200 Subject: [PATCH 1/1] show exception stack traces when debugging is on --- data/config.default.php | 1 + data/templates/exception.htm | 3 +++ www/www-header.php | 8 +++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/data/config.default.php b/data/config.default.php index cec3799..804ff5e 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -1,5 +1,6 @@ false, 'gitdir' => __DIR__ . '/../repos/git/', 'workdir' => __DIR__ . '/../repos/work/', 'tpl' => __DIR__ . '/templates/', diff --git a/data/templates/exception.htm b/data/templates/exception.htm index 99fddb9..dc07fc5 100644 --- a/data/templates/exception.htm +++ b/data/templates/exception.htm @@ -10,6 +10,9 @@

{{exception.getMessage}}

+ {% if debug %} +
{{exception.getTraceAsString}}
+ {% endif %} diff --git a/www/www-header.php b/www/www-header.php index 77ee758..0a3b562 100644 --- a/www/www-header.php +++ b/www/www-header.php @@ -21,7 +21,13 @@ set_exception_handler( } else { header('HTTP/1.0 500 Internal server error'); } - render('exception', array('exception' => $e)); + render( + 'exception', + array( + 'exception' => $e, + 'debug' => $GLOBALS['phorkie']['cfg']['debug'] + ) + ); exit(); } ); -- 2.30.2