input/curl: set GError when init() fails
Let the caller know what happened, he's responsible for logging.
This commit is contained in:
parent
5bba2df526
commit
37c8f5c1da
@ -118,8 +118,9 @@ input_curl_init(const struct config_param *param,
|
|||||||
{
|
{
|
||||||
CURLcode code = curl_global_init(CURL_GLOBAL_ALL);
|
CURLcode code = curl_global_init(CURL_GLOBAL_ALL);
|
||||||
if (code != CURLE_OK) {
|
if (code != CURLE_OK) {
|
||||||
g_warning("curl_global_init() failed: %s\n",
|
g_set_error(error_r, curl_quark(), code,
|
||||||
curl_easy_strerror(code));
|
"curl_global_init() failed: %s\n",
|
||||||
|
curl_easy_strerror(code));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user