From efb4f8a15a9818673c08b0ed4f4f86106de01f54 Mon Sep 17 00:00:00 2001 From: Jim Broadus Date: Thu, 6 Feb 2020 11:09:37 -0800 Subject: [PATCH] Handle errors from icecast directory requests. When a request fails, show an error dialog and don't attempt to parse results. --- src/internet/icecast/icecastservice.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/internet/icecast/icecastservice.cpp b/src/internet/icecast/icecastservice.cpp index 52c76d421..84b46a03f 100644 --- a/src/internet/icecast/icecastservice.cpp +++ b/src/internet/icecast/icecastservice.cpp @@ -125,6 +125,14 @@ void IcecastService::DownloadDirectoryFinished(QNetworkReply* reply, return; } + if (reply->error() != QNetworkReply::NoError) { + app_->task_manager()->SetTaskFinished(task_id); + app_->AddError(tr("Failed to update icecast directory:\n%1") + .arg(reply->errorString())); + reply->deleteLater(); + return; + } + QFuture future = QtConcurrent::run(this, &IcecastService::ParseDirectory, reply); NewClosure(future, this, SLOT(ParseDirectoryFinished(