Elastica\Exception\ElasticsearchException::_extractException PHP Method

_extractException() protected method

Extract exception name from error response.
protected _extractException ( string $error ) : null | string
$error string
return null | string
    protected function _extractException($error)
    {
        if (preg_match('/^(\\w+)\\[.*\\]/', $error, $matches)) {
            return $matches[1];
        } else {
            return;
        }
    }