From f098e82043520c712a31cc84175fcabb2f721ba0 Mon Sep 17 00:00:00 2001 From: Ibrahim BinAlshikh Date: Tue, 9 Jan 2024 01:50:32 +0300 Subject: [PATCH 1/2] Update Handler.php --- webfiori/error/Handler.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/webfiori/error/Handler.php b/webfiori/error/Handler.php index 4f6eb4c..9dc8c61 100644 --- a/webfiori/error/Handler.php +++ b/webfiori/error/Handler.php @@ -97,15 +97,15 @@ class Handler { private $exceptionsHandler; private $shutdownFunction; private function __construct() { - //ini_set('display_startup_errors', 1); - //ini_set('display_errors', 1); + ini_set('display_startup_errors', 1); + ini_set('display_errors', 1); error_reporting(-1); $this->errToExceptionHandler = function (int $errno, string $errString, string $errFile, int $errLine) { //Convert errors to exceptions $errClass = TraceEntry::extractClassName($errFile); $errType = Handler::ERR_TYPES[$errno]; $message = 'An exception caused by an error. '.$errType['description'].': '.$errString.' at '.$errClass.' Line '.$errLine; - throw new ErrorHandlerException($message, $errno, $errFile); + throw new ErrorHandlerException($message, $errno, $errFile, $errLine); }; $this->exceptionsHandler = function (Throwable $ex = null) { Handler::get()->lastException = $ex; @@ -141,9 +141,8 @@ private function __construct() { } }; $this->isErrOccured = false; - set_exception_handler($this->exceptionsHandler); set_error_handler($this->errToExceptionHandler); - + set_exception_handler($this->exceptionsHandler); register_shutdown_function($this->shutdownFunction); $this->handlersPool = []; $this->handlersPool[] = new DefaultHandler(); From 0a2151c1d5b510dff852b531af42cd353ffb5669 Mon Sep 17 00:00:00 2001 From: Ibrahim BinAlshikh Date: Tue, 9 Jan 2024 01:50:37 +0300 Subject: [PATCH 2/2] Update ErrorHandlerException.php --- webfiori/error/ErrorHandlerException.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webfiori/error/ErrorHandlerException.php b/webfiori/error/ErrorHandlerException.php index 5ffb123..0daee20 100644 --- a/webfiori/error/ErrorHandlerException.php +++ b/webfiori/error/ErrorHandlerException.php @@ -1,13 +1,13 @@ debugTrace = []; $trace = debug_backtrace(); $line = null;