X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Ferrors.inc;h=53587df6ed081b1489e162d77898d474e48f3ed6;hb=19ddc3939071044c8e94b628f1d6a039f50cc493;hp=c5414d60b92b26aca3d27fa8b641a5b7c2fd7421;hpb=f8219593c85e1020093b93972386fd477675504f;p=fa-stable.git
diff --git a/includes/errors.inc b/includes/errors.inc
index c5414d60..53587df6 100644
--- a/includes/errors.inc
+++ b/includes/errors.inc
@@ -21,7 +21,8 @@ function get_backtrace($html = false, $skip=0)
foreach($trace as $trn => $tr) {
if ($trn <= $skip) continue;
if ($html) $str .= '
';
- $str .= $tr['file'].':'.$tr['line'].': ';
+ if (isset($tr['file']) && isset($tr['line']))
+ $str .= $tr['file'].':'.$tr['line'].': ';
if ($html) $str .= ' | ';
if (isset($tr['type'])) {
if($tr['type'] == '::') {
@@ -32,7 +33,7 @@ function get_backtrace($html = false, $skip=0)
}
$str .= $tr['function'].'(';
- if(is_array($tr['args'])) {
+ if(isset($tr['args']) && is_array($tr['args'])) {
$args = array();
foreach($tr['args'] as $n=>$a) {
if (is_object($tr['args'][$n]))
@@ -87,6 +88,13 @@ function error_handler($errno, $errstr, $file, $line) {
return true;
}
+
+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
// FIX center is unused now
|