summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class11
1 files changed, 9 insertions, 2 deletions
diff --git a/it.class b/it.class
index 947f0fe..885dcb6 100644
--- a/it.class
+++ b/it.class
@@ -163,7 +163,7 @@ static function error($p = array())
return null; # prevent recursion
if (!error_reporting() || $p[0] === false || $p['title'] === false) # called with @ or suppressed
- return $p['fatal'] ? exit(99) : null;
+ return $p['fatal'] ? self::_exit($p) : null;
if ($_SERVER['REMOTE_ADDR'])
$url = "http://" . it::replace([':443$' => ""], $_SERVER['HTTP_HOST']) . $_SERVER['REQUEST_URI']; # we ignore https for easier debugging
@@ -301,7 +301,7 @@ static function error($p = array())
it::log("/tmp/alertdata/alertlog", $p['title'] . " in " . ($trace ? $trace : "{$p['file']}:{$p['line']}") . " Url: $url" . ($p['body'] ? "\n" . substr(D($p['body']), 0, 5000) . "\n" : ""));
- return $p['fatal'] ? exit(99) : null;
+ return $p['fatal'] ? self::_exit($p) : null;
}
@@ -324,6 +324,13 @@ static function bail($message = "Bailed.")
exit(1);
}
+static function _exit($p)
+{
+ if ($GLOBALS['it_defaultconfig']['fatal_throws_exception'])
+ throw new Exception($p['title']);
+ exit(99);
+}
+
/**
* Check wether I am on a live server for this service. Honors 'aslive' and 'asdevel' debug vars