Skip to content

Commit

Permalink
FakeErrorReply: Add support for 401
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneRing committed Jan 16, 2024
1 parent ac03543 commit d9d3fcb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/testutils/syncenginetestutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,11 @@ FakeErrorReply::FakeErrorReply(QNetworkAccessManager::Operation op, const QNetwo
setOperation(op);
open(QIODevice::ReadOnly);
setAttribute(QNetworkRequest::HttpStatusCodeAttribute, httpErrorCode);
setError(InternalServerError, QStringLiteral("Internal Server Fake Error"));
if (httpErrorCode == 401) {
setError(AuthenticationRequiredError, QStringLiteral("Fake credentials error"));
} else {
setError(InternalServerError, QStringLiteral("Internal Server Fake Error"));
}
QMetaObject::invokeMethod(this, &FakeErrorReply::respond, Qt::QueuedConnection);
}

Expand Down

0 comments on commit d9d3fcb

Please sign in to comment.