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;
}