protected function _displayException($exception)
    {
        $rendererClassName = App::className($this->_options['exceptionRenderer'], 'Error');
        try {
            if (!$rendererClassName) {
                throw new Exception("$rendererClassName is an invalid class.");
            }
            /** @var \Cake\Error\ExceptionRendererInterface $renderer */
            $renderer = new $rendererClassName($exception);
            $response = $renderer->render();
            $this->_clearOutput();
            $this->_sendResponse($response);
        } catch (Throwable $exception) {
            $this->_logInternalError($exception);
        } catch (Exception $exception) {
            $this->_logInternalError($exception);
        }
    }
protected function _displayException($exception)
    {
        $rendererClassName = App::className($this->_options['exceptionRenderer'], 'Error');
        try {
            if (!$rendererClassName) {
                throw new Exception("$rendererClassName is an invalid class.");
            }
            /** @var \Cake\Error\ExceptionRendererInterface $renderer */
            $renderer = new $rendererClassName($exception);
            $response = $renderer->render();
            $this->_clearOutput();
            $this->_sendResponse($response);
        } catch (Throwable $exception) {
            $this->_logInternalError($exception);
        } catch (Exception $exception) {
            $this->_logInternalError($exception);
        }
    }
protected function _displayException ( $ exception ) { $ rendererClassName = App :: className ( $ this -> _options [ 'exceptionRenderer' ] , 'Error' ) ; try { if ( ! $ rendererClassName ) { throw new Exception ( "$rendererClassName is an invalid class." ) ; } /** @var \Cake\Error\ExceptionRendererInterface $renderer */ $ renderer = new $ rendererClassName ( $ exception ) ; $ response = $ renderer -> render ( ) ; $ this -> _clearOutput ( ) ; $ this -> _sendResponse ( $ response ) ; } catch ( Throwable $ exception ) { $ this -> _logInternalError ( $ exception ) ; } catch ( Exception $ exception ) { $ this -> _logInternalError ( $ exception ) ; } }
Displays an exception response body.

@param \Exception $exception The exception to display.
@return void
@throws \Exception When the chosen exception renderer is invalid.
Displays an exception response body .