From e9058c61e2c78f6e5e04c8e5aa3c44a1e0d02434 Mon Sep 17 00:00:00 2001 From: Victor Tran Date: Wed, 16 Jan 2019 00:35:20 +1100 Subject: Abort on download error --- installer/process/installworker.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'installer/process/installworker.cpp') diff --git a/installer/process/installworker.cpp b/installer/process/installworker.cpp index a297420..d4f5c5b 100644 --- a/installer/process/installworker.cpp +++ b/installer/process/installworker.cpp @@ -91,6 +91,10 @@ bool InstallWorker::startWork() { lastBytesReceived = 0; lastTimeUpdate = QDateTime::fromMSecsSinceEpoch(0); connect(reply, &QNetworkReply::finished, [=] { + if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() != 200) { + QApplication::exit(1); + return; + } packageFile.flush(); packageFile.seek(0); -- cgit v1.2.3