Skip to content

Kohana_Core::error_handler bypasses HTTP_Exception_500 handlers #598

@baronmog

Description

@baronmog

In Kohana/Core.php:990, the error_handler() function throws ErrorException (not HTTP_Exception), which leads to Kohana_Exception::_handler() manually creating a response with a status of 500, bypassing both the HTTP_Exception_500 and generic HTTP_Exception handlers.

public static function error_handler($code, $error, $file = NULL, $line = NULL)
{
    if (error_reporting() & $code)
    {
        // This error is not suppressed by current error reporting settings
        // Convert the error into an ErrorException
        throw new ErrorException($error, $code, 0, $file, $line);
    }

    // Do not execute the PHP error handler
    return TRUE;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions