src/Core/Error/ErrorManager.php
public function exception($exception)
    {
        try {
            foreach ($this->handlers as $handler) {
                $handler($exception);
            }
        } catch (\Throwable $e) {
            $msg = "Infinity loop in exception & error handler. \nMessage:\n" . $e;

            if ($this->app->get('system.debug')) {
                exit($msg);
            }

            exit($e->getMessage());
        }

        exit();
    }
public function exception($exception)
    {
        try {
            foreach ($this->handlers as $handler) {
                $handler($exception);
            }
        } catch (\Throwable $e) {
            $msg = "Infinity loop in exception & error handler. \nMessage:\n" . $e;

            if ($this->app->get('system.debug')) {
                exit($msg);
            }

            exit($e->getMessage());
        }

        exit();
    }
public function exception ( $ exception ) { try { foreach ( $ this -> handlers as $ handler ) { $ handler ( $ exception ) ; } } catch ( \ Throwable $ e ) { $ msg = "Infinity loop in exception & error handler. \nMessage:\n" . $ e ; if ( $ this -> app -> get ( 'system.debug' ) ) { exit ( $ msg ) ; } exit ( $ e -> getMessage ( ) ) ; } exit ( ) ; }
The exception handler.

@param \Throwable|\Exception $exception The exception object.

@return  void

@link  http://php.net/manual/en/function.set-exception-handler.php
The exception handler .