Elastica\Exception\Connection\HttpException::getErrorMessage PHP Метод

getErrorMessage() публичный Метод

Returns the error message corresponding to the error code cUrl error code reference can be found here {@link http://curl.haxx.se/libcurl/c/libcurl-errors.html}.
public getErrorMessage ( string $error ) : string
$error string Error code
Результат string Error message
    public function getErrorMessage($error)
    {
        switch ($error) {
            case CURLE_UNSUPPORTED_PROTOCOL:
                return 'Unsupported protocol';
            case CURLE_FAILED_INIT:
                return 'Internal cUrl error?';
            case CURLE_URL_MALFORMAT:
                return 'Malformed URL';
            case CURLE_COULDNT_RESOLVE_PROXY:
                return "Couldn't resolve proxy";
            case CURLE_COULDNT_RESOLVE_HOST:
                return "Couldn't resolve host";
            case CURLE_COULDNT_CONNECT:
                return "Couldn't connect to host, Elasticsearch down?";
            case 28:
                return 'Operation timed out';
        }
        return 'Unknown error:' . $error;
    }