From: Johan Cwiklinski Date: Sat, 18 Jul 2020 07:55:15 +0000 (+0200) Subject: Throw exception on notices in DEV mode X-Git-Tag: 0.9.4.1~75 X-Git-Url: https://git.agnieray.net/?a=commitdiff_plain;h=bc7162e63940806822e16cb76b0683c4dc0797f2;p=galette.git Throw exception on notices in DEV mode --- diff --git a/galette/includes/main.inc.php b/galette/includes/main.inc.php index 27ac7f502..bc02af5d6 100644 --- a/galette/includes/main.inc.php +++ b/galette/includes/main.inc.php @@ -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