Kohana: Uncaught TypeError: Argument 1 passed to Kohana_Kohana_Exception::handler() must be an instance of Exception« Wróć do listy pytań

instance of Error given in /system/classes/Kohana/Kohana/Exception.php:84 Stack trace: #0 [internal function]: Kohana_Kohana_Exception::handler(Object(Error)) #1 {main} thrown
Wysłane przez mrmucha
Zadane przez 22/11/2019 09:45
0

1. open index.php
2. find

if (PHP_SAPI == 'cli') // Try and load minion
{
	class_exists('Minion_Task') OR die('Please enable the Minion module for CLI support.');
	set_exception_handler(array('Minion_Exception', 'handler'));

	Minion_Task::factory(Minion_CLI::options())->execute();
}
else
{
	/**
	 * Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO'].
	 * If no source is specified, the URI will be automatically detected.
	 */
	echo Request::factory(TRUE, array(), FALSE)
		->execute()
		->send_headers(TRUE)
		->body();
}

3. change to

if (PHP_SAPI == 'cli') // Try and load minion
{
	class_exists('Minion_Task') OR die('Please enable the Minion module for CLI support.');
	set_exception_handler(array('Minion_Exception', 'handler'));

	Minion_Task::factory(Minion_CLI::options())->execute();
}
else
{
    try
    {

        echo Request::factory(TRUE, array(), FALSE)
            ->execute()
            ->send_headers(TRUE)
            ->body();
    }
    catch (Error $e) //  php7 Throwable
    {
        throw new ErrorException($e->getMessage(), $e->getCode(), 0, $e->getFile(), $e->getLine());
    }
}
Wysłane przez mrmucha
Odpowiedziane 22/11/2019 09:46