kohana / minion

Everyone loves having a minion they can boss around
113 stars 76 forks source link

log error #105

Closed ljyf5593 closed 10 years ago

ljyf5593 commented 10 years ago

log the error, maybe someone conn't see the error on the screen

acoulton commented 10 years ago

@ljyf5593 thanks - the change looks good to me, but 3.3/master is only for releases.

Could you please:

Thanks very much

cyrrill commented 10 years ago

@ljyf5593 @acoulton I might be looking at the wrong place, but as far as I can see Kohana_Exception::_handler($e) has an HTTP-centric try{}, setting a header, the later echoing. Which we don't want at all in CLI.

I think what you want is the single call to "Kohana_Exception::log($e);" instead of "_handler", because its already inside a try{} in Minion_Exception anyways?...

    /**
     * Exception handler, logs the exception and generates a Response object
     * for display.
     *
     * @uses    Kohana_Exception::response
     * @param   Exception  $e
     * @return  Response
     */
    public static function _handler(Exception $e)
    {
        try
        {
            // Log the exception
            Kohana_Exception::log($e);

            // Generate the response
            $response = Kohana_Exception::response($e);

            return $response;
        }
        catch (Exception $e)
        {
            /**
             * Things are going *really* badly for us, We now have no choice
             * but to bail. Hard.
             */
            // Clean the output buffer if one exists
            ob_get_level() AND ob_clean();

            // Set the Status code to 500, and Content-Type to text/plain.
            header('Content-Type: text/plain; charset='.Kohana::$charset, TRUE, 500);

            echo Kohana_Exception::text($e);

            exit(1);
        }
    }
ljyf5593 commented 10 years ago

@cyrgit yes, you are right. thank you ! had create a new pull request

acoulton commented 10 years ago

Closed by #106