From 056a6001aceddcf707974577d3566b1a166f01ec Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sat, 3 Aug 2013 02:01:52 -0400 Subject: Erorr handling update --- inc/display.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'inc/display.php') diff --git a/inc/display.php b/inc/display.php index 4972d563..dddb6559 100644 --- a/inc/display.php +++ b/inc/display.php @@ -58,7 +58,7 @@ function createBoardlist($mod=false) { } function error($message, $priority = true, $debug_stuff = false) { - global $board, $mod, $config; + global $board, $mod, $config, $db_error; if ($config['syslog'] && $priority !== false) { // Use LOG_NOTICE instead of LOG_ERR or LOG_WARNING because most error message are not significant. @@ -70,6 +70,10 @@ function error($message, $priority = true, $debug_stuff = false) { die('Error: ' . $message . "\n"); } + if ($config['debug'] && isset($db_error)) { + $debug_stuff = array_combine(array('SQLSTATE', 'Error code', 'Error message'), $db_error); + } + die(Element('page.html', array( 'config' => $config, 'title' => _('Error'), -- cgit v1.3