forked from leftypol/leftypol
Erorr handling update
This commit is contained in:
parent
784c3ffadb
commit
056a6001ac
4 changed files with 25 additions and 20 deletions
|
@ -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'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue