Skip to content

Commit

Permalink
[Aircraft config] Check for errors in http request reply.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabien-B authored and Fabien-B committed May 30, 2024
1 parent d68609b commit 22c7016
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/tools/AircraftManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,13 @@ void ConfigData::setData(QDomDocument* doc, QString uri) {
auto netacc = new QNetworkAccessManager(this);
connect(netacc, &QNetworkAccessManager::finished, this, [=](QNetworkReply* reply) {
auto data = reply->readAll();
doc->setContent(data);
if(isComplete()) {
emit configReady(this);
if(reply->error() == QNetworkReply::NetworkError::NoError) {
doc->setContent(data);
if(isComplete()) {
emit configReady(this);
}
} else {
qDebug() << "Error for" << uri << ":" << reply->error();
}
reply->deleteLater();
});
Expand Down

0 comments on commit 22c7016

Please sign in to comment.