foreach($trace as $trn => $tr) {
if ($trn <= $skip) continue;
if ($html) $str .= '<tr><td>';
foreach($trace as $trn => $tr) {
if ($trn <= $skip) continue;
if ($html) $str .= '<tr><td>';
if ($html) $str .= '</td><td>';
if (isset($tr['type'])) {
if($tr['type'] == '::') {
if ($html) $str .= '</td><td>';
if (isset($tr['type'])) {
if($tr['type'] == '::') {
+
+function exception_handler($exception)
+{
+ error_handler(E_ERROR, sprintf(_("Unhandled exception [%s]: %s."), $exception->getCode(), $exception->getMessage()),
+ $exception->getFile(), $exception->getLine());
+ end_page();
+}
//------------------------------------------------------------------------------
// Formats system messages before insert them into message <div>
// FIX center is unused now
function fmt_errors($center=false) {
global $messages, $path_to_root, $SysPrefs;
//------------------------------------------------------------------------------
// Formats system messages before insert them into message <div>
// FIX center is unused now
function fmt_errors($center=false) {
global $messages, $path_to_root, $SysPrefs;
- $msg_class = array(
- E_USER_ERROR => 'err_msg',
- E_USER_WARNING =>'warn_msg',
- E_USER_NOTICE => 'note_msg');
-
- $type = E_USER_NOTICE;
- $content = '';
-// $class = 'no_msg';
- if (count($messages)) {
- foreach($messages as $cnt=>$msg) {
- if ($SysPrefs->go_debug && $msg[0]>E_USER_NOTICE)
- $msg[0] = E_ERROR;
-
- if ($msg[0]>$type) continue;
-
- if ($msg[0]<$type) {
- if ($msg[0] == E_USER_WARNING) {
- $type = E_USER_WARNING; // user warnings
- $content = ''; // clean notices when we have errors
- } else {
- $type = E_USER_ERROR; // php or user errors
- if($type == E_USER_WARNING)
- $content = ''; // clean other messages
+ $msg_class = array(
+ E_USER_ERROR => 'err_msg',
+ E_USER_WARNING =>'warn_msg',
+ E_USER_NOTICE => 'note_msg');
+
+ $type = E_USER_NOTICE;
+ $content = '';
+
+ if (count($messages)) {
+ foreach($messages as $cnt=>$msg) {
+ if ($SysPrefs->go_debug && $msg[0]>E_USER_NOTICE)
+ $msg[0] = E_ERROR;
+
+ if ($msg[0]>$type) continue;
+
+ if ($msg[0]<$type) {
+ if ($msg[0] == E_USER_WARNING) {
+ $type = E_USER_WARNING; // user warnings
+ $content = ''; // clean notices when we have errors
+ } else {
+ $type = E_USER_ERROR; // php or user errors
+ if($type == E_USER_WARNING)
+ $content = ''; // clean other messages
+ }
- $str = $msg[1];
- if (!in_array($msg[0], array(E_USER_NOTICE, E_USER_ERROR, E_USER_WARNING)) && $msg[2] != null)
- $str .= ' '._('in file').': '.$msg[2].' '._('at line ').$msg[3];
+ $str = $msg[1];
+ if (!in_array($msg[0], array(E_USER_NOTICE, E_USER_ERROR, E_USER_WARNING)) && $msg[2] != null)
+ $str .= ' '._('in file').': '.$msg[2].' '._('at line ').$msg[3];
- if ($SysPrefs->go_debug>1 && $type!=E_USER_NOTICE && $type!=E_USER_WARNING)
- $str .= '<br>'.$msg[4];
- $content .= ($cnt ? '<hr>' : '').$str;
- }
- $class = $msg_class[$type];
- $content = "<div class='$class'>$content</div>";
- } else
- if ($path_to_root=='.')
- return '';
- return $content;
+ if ($SysPrefs->go_debug>1 && $type!=E_USER_NOTICE && $type!=E_USER_WARNING)
+ $str .= '<br>'.$msg[4];
+ $content .= ($cnt ? '<hr>' : '').$str;
+ }
+ $class = $msg_class[$type];
+ $content = "<div class='$class'>$content</div>";
+ } elseif ($path_to_root=='.')
+ return '';
+ return $content;
}
//-----------------------------------------------------------------------------
// Error box <div> element.
}
//-----------------------------------------------------------------------------
// Error box <div> element.
$cur_prefix = $db_connections[$_SESSION["wa_current_user"]->cur_con]['tbpref'];
$str .= "sql that failed was : ".str_replace(TB_PREF, $cur_prefix, $sql_statement)."<br>";
$cur_prefix = $db_connections[$_SESSION["wa_current_user"]->cur_con]['tbpref'];
$str .= "sql that failed was : ".str_replace(TB_PREF, $cur_prefix, $sql_statement)."<br>";