Show full Wikipedia 429 error message
This commit is contained in:
parent
fd59e2a9a4
commit
3ba7eaefd0
3 changed files with 45 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue