Skip to content

Commit 22c7016

Browse files
Fabien-BFabien-B
authored andcommitted
[Aircraft config] Check for errors in http request reply.
1 parent d68609b commit 22c7016

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/tools/AircraftManager.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,13 @@ void ConfigData::setData(QDomDocument* doc, QString uri) {
183183
auto netacc = new QNetworkAccessManager(this);
184184
connect(netacc, &QNetworkAccessManager::finished, this, [=](QNetworkReply* reply) {
185185
auto data = reply->readAll();
186-
doc->setContent(data);
187-
if(isComplete()) {
188-
emit configReady(this);
186+
if(reply->error() == QNetworkReply::NetworkError::NoError) {
187+
doc->setContent(data);
188+
if(isComplete()) {
189+
emit configReady(this);
190+
}
191+
} else {
192+
qDebug() << "Error for" << uri << ":" << reply->error();
189193
}
190194
reply->deleteLater();
191195
});

0 commit comments

Comments
 (0)