kernel/private/classes/ezpkerneltreemenu.php
protected function exitWithInternalError( $errorMessage, $errorCode = 500 )
    {
        if ( eZModule::$useExceptions )
        {
            switch ( $errorCode )
            {
                case 403:
                    throw new ezpAccessDenied( $errorMessage );

                case 500:
                default:
                    throw new RuntimeException( $errorMessage, $errorCode );
            }
        }
        else
        {
            header( $_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error' );
            eZExecution::cleanup();
            eZExecution::setCleanExit();

            return new ezpKernelResult(
                json_encode(
                    array(
                        'error'        => $errorMessage,
                        'code'         => $errorCode
                    )
                )
            );
        }
    }
protected function exitWithInternalError( $errorMessage, $errorCode = 500 )
    {
        if ( eZModule::$useExceptions )
        {
            switch ( $errorCode )
            {
                case 403:
                    throw new ezpAccessDenied( $errorMessage );

                case 500:
                default:
                    throw new RuntimeException( $errorMessage, $errorCode );
            }
        }
        else
        {
            header( $_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error' );
            eZExecution::cleanup();
            eZExecution::setCleanExit();

            return new ezpKernelResult(
                json_encode(
                    array(
                        'error'        => $errorMessage,
                        'code'         => $errorCode
                    )
                )
            );
        }
    }
protected function exitWithInternalError ( $ errorMessage , $ errorCode = 500 ) { if ( eZModule :: $ useExceptions ) { switch ( $ errorCode ) { case 403 : throw new ezpAccessDenied ( $ errorMessage ) ; case 500 : default : throw new RuntimeException ( $ errorMessage , $ errorCode ) ; } } else { header ( $ _SERVER [ 'SERVER_PROTOCOL' ] . ' 500 Internal Server Error' ) ; eZExecution :: cleanup ( ) ; eZExecution :: setCleanExit ( ) ; return new ezpKernelResult ( json_encode ( array ( 'error' => $ errorMessage , 'code' => $ errorCode ) ) ) ; } }
Handles an internal error.
If not using exceptions, will return an ezpKernelResult object with JSON encoded message.

@param string $errorMessage
@param int $errorCode
@return ezpKernelResult

@throws RuntimeException
@throws ezpAccessDenied

@see setUseExceptions()
Handles an internal error . If not using exceptions will return an ezpKernelResult object with JSON encoded message .