Show Json parse error

This commit is contained in:
Jonas Kvinge
2020-05-10 12:48:48 +02:00
parent fe3af3a676
commit dfecd0cd12
4 changed files with 10 additions and 14 deletions

View File

@@ -85,11 +85,9 @@ void MusixmatchLyricsProvider::HandleSearchReply(QNetworkReply *reply, const qui
LyricsSearchResults results;
if (reply->error() != QNetworkReply::NoError) {
if (reply->error() < 200) {
Error(QString("%1 (%2)").arg(reply->errorString()).arg(reply->error()));
emit SearchFinished(id, results);
return;
}
Error(QString("%1 (%2)").arg(reply->errorString()).arg(reply->error()));
emit SearchFinished(id, results);
return;
}
else if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() != 200) {
Error(QString("Received HTTP code %1").arg(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt()));