]> git.agnieray.net Git - galette.git/commitdiff
Throw exception on notices in DEV mode
authorJohan Cwiklinski <johan@x-tnd.be>
Sat, 18 Jul 2020 07:55:15 +0000 (09:55 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Sat, 18 Jul 2020 07:55:15 +0000 (09:55 +0200)
galette/includes/main.inc.php

index 27ac7f502159398e66f8990962d59e95d853a0db..bc02af5d68a0fcec0728d9797b1c5fa61e94b1ce 100644 (file)
@@ -100,6 +100,13 @@ if ($needs_update) {
     );
 }
 
+//handle notices
+set_error_handler(function ($severity, $message, $file, $line) {
+    if (GALETTE_MODE === 'DEV') {
+        throw new \ErrorException($message, 0, $severity, $file, $line);
+    }
+});
+
 //Session duration
 if (!defined('GALETTE_TIMEOUT')) {
     //See https://php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime