src/Error/ExceptionRenderer.php
protected function _getErrorData()
    {
        $data = [];

        $viewVars = $this->controller->viewVars;
        if (!empty($viewVars['_serialize'])) {
            foreach ($viewVars['_serialize'] as $v) {
                $data[$v] = $viewVars[$v];
            }
        }

        if (!empty($viewVars['error']) && Configure::read('debug')) {
            $data['exception'] = [
                'class' => get_class($viewVars['error']),
                'code' => $viewVars['error']->getCode(),
                'message' => $viewVars['error']->getMessage(),
            ];

            if (!isset($data['trace'])) {
                $data['trace'] = Debugger::formatTrace($viewVars['error']->getTrace(), [
                    'format' => 'array',
                    'args' => false
                ]);
            }
        }

        return $data;
    }
protected function _getErrorData()
    {
        $data = [];

        $viewVars = $this->controller->viewVars;
        if (!empty($viewVars['_serialize'])) {
            foreach ($viewVars['_serialize'] as $v) {
                $data[$v] = $viewVars[$v];
            }
        }

        if (!empty($viewVars['error']) && Configure::read('debug')) {
            $data['exception'] = [
                'class' => get_class($viewVars['error']),
                'code' => $viewVars['error']->getCode(),
                'message' => $viewVars['error']->getMessage(),
            ];

            if (!isset($data['trace'])) {
                $data['trace'] = Debugger::formatTrace($viewVars['error']->getTrace(), [
                    'format' => 'array',
                    'args' => false
                ]);
            }
        }

        return $data;
    }
protected function _getErrorData ( ) { $ data = [ ] ; $ viewVars = $ this -> controller -> viewVars ; if ( ! empty ( $ viewVars [ '_serialize' ] ) ) { foreach ( $ viewVars [ '_serialize' ] as $ v ) { $ data [ $ v ] = $ viewVars [ $ v ] ; } } if ( ! empty ( $ viewVars [ 'error' ] ) && Configure :: read ( 'debug' ) ) { $ data [ 'exception' ] = [ 'class' => get_class ( $ viewVars [ 'error' ] ) , 'code' => $ viewVars [ 'error' ] -> getCode ( ) , 'message' => $ viewVars [ 'error' ] -> getMessage ( ) , ] ; if ( ! isset ( $ data [ 'trace' ] ) ) { $ data [ 'trace' ] = Debugger :: formatTrace ( $ viewVars [ 'error' ] -> getTrace ( ) , [ 'format' => 'array' , 'args' => false ] ) ; } } return $ data ; }
Helper method used to generate extra debugging data into the error template

@return array debugging data
Helper method used to generate extra debugging data into the error template