diff options
| author | Silarn <jrim@rimpo.org> | 2019-01-28 00:01:55 -0600 |
|---|---|---|
| committer | Silarn <jrim@rimpo.org> | 2019-02-18 21:28:07 -0600 |
| commit | 56f9ba159b72a303ea388f466fa4e5ed57a6f45b (patch) | |
| tree | c073ff9ac2e055a8999d996467654259de6edf4d /src/nexusinterface.cpp | |
| parent | f6dcc77158fef63b80d00e33d02363f2eb69b2bc (diff) | |
Detect throttling with error code 429
Diffstat (limited to 'src/nexusinterface.cpp')
| -rw-r--r-- | src/nexusinterface.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nexusinterface.cpp b/src/nexusinterface.cpp index 760af6a9..080b4f7e 100644 --- a/src/nexusinterface.cpp +++ b/src/nexusinterface.cpp @@ -553,6 +553,11 @@ void NexusInterface::requestFinished(std::list<NXMRequestInfo>::iterator iter) if (reply->error() != QNetworkReply::NoError) { qWarning("request failed: %s", reply->errorString().toUtf8().constData()); emit nxmRequestFailed(iter->m_GameName, iter->m_ModID, iter->m_FileID, iter->m_UserData, iter->m_ID, reply->error(), reply->errorString()); + int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + if (statusCode == 429) { + m_RemainingRequests = 0; + qWarning() << tr("Requests have hit the rate limit threshold and are now being throttled."); + } } else { int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); if (statusCode == 301) { |
