Fix reporting the right error in a GET

We always reported the lack of e-tag instead of the real error
This commit is contained in:
Olivier Goffart 2014-05-02 17:25:13 +02:00
parent 6c44f53645
commit 2e76fe87c2

View File

@ -377,8 +377,8 @@ void GETFileJob::start() {
void GETFileJob::slotMetaDataChanged()
{
qDebug() << Q_FUNC_INFO << reply()->error() << reply()->errorString() << reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute);
if (reply()->error() != QNetworkReply::NoError ) {
if (reply()->error() != QNetworkReply::NoError
|| reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() / 100 != 2) {
// We will handle the error when the job is finished.
return;
}