Skip to content

Commit

Permalink
Merge pull request #164 from Alasnkz/error-429
Browse files Browse the repository at this point in the history
Print an error for when a 429 is encountered.
  • Loading branch information
Alasnkz authored Nov 7, 2020
2 parents bd5cb88 + 687e1d3 commit 7d989cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ void Http::NetworkThreadFunc()

do_reconnect = true;
}
else if (response.result_int() == 429 /* rate limited */)
{
Logger::Get()->Log(LogLevel::ERROR, "Got a 429 from path '{}' (bucket '{}') this should not happen.",
entry->Request->target().to_string(), GetBucketIdentifierFromURL(entry->Request->target().to_string()));
}
}

if (do_reconnect)
Expand All @@ -154,7 +159,6 @@ void Http::NetworkThreadFunc()
if (skip_entry)
continue; // continue queue loop


auto it_r = response.find("X-RateLimit-Remaining");
if (it_r != response.end())
{
Expand Down

0 comments on commit 7d989cf

Please sign in to comment.