aboutsummaryrefslogtreecommitdiff
path: root/lib/Exceptions.php
diff options
context:
space:
mode:
authorMaZderMind2015-03-27 14:21:34 +0100
committerMaZderMind2015-03-31 08:19:08 +0200
commit1a050c087e8f2889b421992350c50fae75a9252b (patch)
tree16cebecacf7063925c1c6e815ed8c3e2927fc829 /lib/Exceptions.php
parentf98d93cd1559d48e76366950c51e5a6a1f7a84dc (diff)
error handling
Diffstat (limited to 'lib/Exceptions.php')
-rw-r--r--lib/Exceptions.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Exceptions.php b/lib/Exceptions.php
index f6f9d24..acdb1b6 100644
--- a/lib/Exceptions.php
+++ b/lib/Exceptions.php
@@ -1,4 +1,12 @@
<?php
+function exception_error_handler($errno, $errstr, $errfile, $errline ) {
+ if (ini_get('error_reporting') == 0)
+ return;
+
+ throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
+}
+set_error_handler("exception_error_handler");
+
class NotFoundException extends Exception {}
class ScheduleException extends Exception {}