added Error msg on failed curl call

pull/23/head
JuanJakobo 2021-02-15 21:53:15 +01:00
parent 8c0a1d3218
commit bfa3ad9751
1 changed files with 14 additions and 8 deletions

View File

@ -191,6 +191,10 @@ void Nextcloud::downloadItem(vector<Item> &tempItems, int itemID)
break; break;
} }
} }
else
{
Message(ICON_ERROR, "Error", ("An curl error occured (Error Code: " + Util::valueToString(res) + ").").c_str(), 4000);
}
} }
} }
@ -268,7 +272,6 @@ vector<Item> Nextcloud::getDataStructure(const string &pathUrl, const string &Us
Log::writeLog("Starting download of DataStructure"); Log::writeLog("Starting download of DataStructure");
string readBuffer; string readBuffer;
CURLcode res; CURLcode res;
CURL *curl = curl_easy_init(); CURL *curl = curl_easy_init();
@ -351,6 +354,10 @@ vector<Item> Nextcloud::getDataStructure(const string &pathUrl, const string &Us
return getOfflineStructure(pathUrl); return getOfflineStructure(pathUrl);
} }
} }
else
{
Message(ICON_ERROR, "Error", ("An curl error occured (Error Code: " + Util::valueToString(res) + ").").c_str(), 4000);
}
} }
return {}; return {};
} }
@ -413,7 +420,6 @@ vector<Item> Nextcloud::readInXML(string xml)
} }
return tempItems; return tempItems;
} }
string Nextcloud::getLocalPath(string path) string Nextcloud::getLocalPath(string path)