Erorr handling update

This commit is contained in:
Michael Foster 2013-08-03 02:01:52 -04:00
parent 784c3ffadb
commit 056a6001ac
4 changed files with 25 additions and 20 deletions

View file

@ -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'),