lib/Elastica/Response.php
public function getError()
    {
        $error = $this->getFullError();

        if (!$error) {
            return '';
        }

        if (\is_string($error)) {
            return $error;
        }

        $rootError = $error;
        if (isset($error['root_cause'][0])) {
            $rootError = $error['root_cause'][0];
        }

        $message = $rootError['reason'];
        if (isset($rootError['index'])) {
            $message .= ' [index: '.$rootError['index'].']';
        }

        if (isset($error['reason']) && $rootError['reason'] != $error['reason']) {
            $message .= ' [reason: '.$error['reason'].']';
        }

        return $message;
    }
public function getError()
    {
        $error = $this->getFullError();

        if (!$error) {
            return '';
        }

        if (\is_string($error)) {
            return $error;
        }

        $rootError = $error;
        if (isset($error['root_cause'][0])) {
            $rootError = $error['root_cause'][0];
        }

        $message = $rootError['reason'];
        if (isset($rootError['index'])) {
            $message .= ' [index: '.$rootError['index'].']';
        }

        if (isset($error['reason']) && $rootError['reason'] != $error['reason']) {
            $message .= ' [reason: '.$error['reason'].']';
        }

        return $message;
    }
public function getError ( ) { $ error = $ this -> getFullError ( ) ; if ( ! $ error ) { return '' ; } if ( \ is_string ( $ error ) ) { return $ error ; } $ rootError = $ error ; if ( isset ( $ error [ 'root_cause' ] [ 0 ] ) ) { $ rootError = $ error [ 'root_cause' ] [ 0 ] ; } $ message = $ rootError [ 'reason' ] ; if ( isset ( $ rootError [ 'index' ] ) ) { $ message .= ' [index: ' . $ rootError [ 'index' ] . ']' ; } if ( isset ( $ error [ 'reason' ] ) && $ rootError [ 'reason' ] != $ error [ 'reason' ] ) { $ message .= ' [reason: ' . $ error [ 'reason' ] . ']' ; } return $ message ; }
Error message.

@return string Error message
Error message .