public static function exceptionHandler($exception) 
    {
        $message = $exception->getMessage();
        $code = $exception->getCode();
        $file = $exception->getFile();
        $line = $exception->getLine();
        $context = $exception->getTraceAsString();

        self::logError('Exception thrown: ' . $message . ' | ' . $code, null, $file, $line);
        
        // And return a 500 because this error was fatal
        self::http_error('500');
    }
public static function exceptionHandler($exception) 
    {
        $message = $exception->getMessage();
        $code = $exception->getCode();
        $file = $exception->getFile();
        $line = $exception->getLine();
        $context = $exception->getTraceAsString();

        self::logError('Exception thrown: ' . $message . ' | ' . $code, null, $file, $line);
        
        // And return a 500 because this error was fatal
        self::http_error('500');
    }
public static function exceptionHandler ( $ exception ) { $ message = $ exception -> getMessage ( ) ; $ code = $ exception -> getCode ( ) ; $ file = $ exception -> getFile ( ) ; $ line = $ exception -> getLine ( ) ; $ context = $ exception -> getTraceAsString ( ) ; self :: logError ( 'Exception thrown: ' . $ message . ' | ' . $ code , null , $ file , $ line ) ; // And return a 500 because this error was fatal self :: http_error ( '500' ) ; }
Exception handler
Will be triggered when an uncaught exception occures. This function shows the error-message, and shuts down the script.
Please note that most of the user-defined exceptions will be caught in the router, and handled with the error-controller.

@param Exception $exception The occured exception.
Exception handler Will be triggered when an uncaught exception occures . This function shows the error - message and shuts down the script . Please note that most of the user - defined exceptions will be caught in the router and handled with the error - controller .