Forum

Kohana: Uncaught Ty...
 
Notifications
Clear all

Kohana: Uncaught TypeError: Argument 1 passed to Kohana_Kohana_Exception::handler() must be an instance of Exception

1 Posty
2 Users
0 Reactions
4,214 Widok
0
Topic starter
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
1 Answer
0
Topic starter

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());
    }
}

4. Update exception type inside system/classes/Kohana/Kohana/Exception.php

5. change all vars (appears 7 times) from Exception $e to Throwable $e

Odpowiedź

Author Name

Author Email

Your question *

Preview 0 Revisions Saved
Share: