core\Error::handleUncaughtException PHP Method

handleUncaughtException() public static method

public static handleUncaughtException ( Throwable $instance )
$instance Throwable Exception or Error instance
    public static function handleUncaughtException($instance)
    {
        @ob_end_clean();
        if (Database::getInstance() && Database::getInstance()->inTransaction()) {
            Database::getInstance()->rollBack();
        }
        if (!$instance instanceof Error) {
            $instance = new self($instance->getMessage(), intval($instance->getCode()), $instance, $instance->getTrace());
        } elseif ($instance->getCode()) {
            \Helper\Utils::send_http_status($instance->getCode());
        }
        Template::setView('Misc/Error');
        Template::putContext('instance', $instance);
        Filter::preRender();
        Template::render();
        Filter::afterRender();
        exit;
    }