mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 12:03:18 +02:00
networkmanager: changed handle error in sendGetRequest
Change-Id: I3f3b963b7443a5319799e6f6430f9ddd22414d5f
This commit is contained in:
parent
fb420b2ff7
commit
2546b69343
1 changed files with 4 additions and 4 deletions
|
@ -56,12 +56,12 @@ NetworkManager::sendGetRequest(const QUrl& url,
|
|||
std::function<void(const QByteArray&)> onDoneCallback)
|
||||
{
|
||||
auto reply = manager_->get(QNetworkRequest(url));
|
||||
QObject::connect(reply, &QNetworkReply::finished, this, [reply, onDoneCallback]() {
|
||||
QObject::connect(reply, &QNetworkReply::finished, this, [reply, onDoneCallback, this]() {
|
||||
if (reply->error() == QNetworkReply::NoError) {
|
||||
onDoneCallback(reply->readAll());
|
||||
} else {
|
||||
onDoneCallback(reply->errorString().toUtf8());
|
||||
}
|
||||
} else{
|
||||
Q_EMIT errorOccured(GetError::NETWORK_ERROR, reply->errorString());
|
||||
}
|
||||
reply->deleteLater();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue