Show full Wikipedia 429 error message

This commit is contained in:
Edward Betts 2026-05-14 10:15:19 +01:00
parent fd59e2a9a4
commit 3ba7eaefd0
3 changed files with 45 additions and 4 deletions

View file

@ -98,7 +98,7 @@ def api_get(params: StrDict) -> StrDict:
if webpage_error in r.text:
raise MediawikiError(webpage_error)
if r.status_code == 429:
raise MediawikiError("Wikipedia rate limit exceeded — wait a moment and try again.")
raise MediawikiError(r.text)
raise MediawikiError(f"HTTP {r.status_code}: {r.text[:200]!r}")
check_for_error(ret)
return ret