public static function renderError($type, $message, $file, $line)
    {
        if (empty(self::$views['error'])) {
            return null;
        } elseif (preg_match('#allowed\s+memory\s+size\s+of\s+\d+\s+bytes\s+exhausted\s+\(tried\s+to\s+allocate\s+\d+\s+bytes\)#i', $message)) {
            die('<br><strong>Fatal error:</strong> ' . $message . ' in <strong>' . $file . '</strong> on line <strong>' . $line . '</strong>');
        }

        $data = self::details($type, $message, $file, $line);

        if (!headers_sent() && strcasecmp(Request::header('accept'), 'application/json') === 0) {
            ob_start();

            self::unregister();

            Response::cache(0);
            Response::type('application/json');

            echo json_encode($data);

            App::stop(500);
        }

        if (in_array($type, self::$fatal)) {
            View::dispatch();
        }

        self::render(self::$views['error'], $data);
    }
public static function renderError($type, $message, $file, $line)
    {
        if (empty(self::$views['error'])) {
            return null;
        } elseif (preg_match('#allowed\s+memory\s+size\s+of\s+\d+\s+bytes\s+exhausted\s+\(tried\s+to\s+allocate\s+\d+\s+bytes\)#i', $message)) {
            die('<br><strong>Fatal error:</strong> ' . $message . ' in <strong>' . $file . '</strong> on line <strong>' . $line . '</strong>');
        }

        $data = self::details($type, $message, $file, $line);

        if (!headers_sent() && strcasecmp(Request::header('accept'), 'application/json') === 0) {
            ob_start();

            self::unregister();

            Response::cache(0);
            Response::type('application/json');

            echo json_encode($data);

            App::stop(500);
        }

        if (in_array($type, self::$fatal)) {
            View::dispatch();
        }

        self::render(self::$views['error'], $data);
    }
public static function renderError ( $ type , $ message , $ file , $ line ) { if ( empty ( self :: $ views [ 'error' ] ) ) { return null ; } elseif ( preg_match ( '#allowed\s+memory\s+size\s+of\s+\d+\s+bytes\s+exhausted\s+\(tried\s+to\s+allocate\s+\d+\s+bytes\)#i' , $ message ) ) { die ( '<br><strong>Fatal error:</strong> ' . $ message . ' in <strong>' . $ file . '</strong> on line <strong>' . $ line . '</strong>' ) ; } $ data = self :: details ( $ type , $ message , $ file , $ line ) ; if ( ! headers_sent ( ) && strcasecmp ( Request :: header ( 'accept' ) , 'application/json' ) === 0 ) { ob_start ( ) ; self :: unregister ( ) ; Response :: cache ( 0 ) ; Response :: type ( 'application/json' ) ; echo json_encode ( $ data ) ; App :: stop ( 500 ) ; } if ( in_array ( $ type , self :: $ fatal ) ) { View :: dispatch ( ) ; } self :: render ( self :: $ views [ 'error' ] , $ data ) ; }
Render a View to error

@param int    $type
@param string $message
@param string $file
@param int    $line
@return void
Render a View to error