Raise error on a 509 response (too many sessions) (#99)
* Raise error on a 509 response (too many sessions) When the response code is 509, raise an error with an explanation (based on the actual error message contained in the response HTML). * Raise error on a 509 response (too many sessions) - linting
This commit is contained in:
parent
5a7fc7d568
commit
6dc6124dc4
@ -228,6 +228,14 @@ class Url:
|
|||||||
response=response,
|
response=response,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if response.status_code == 509:
|
||||||
|
raise WaybackError(
|
||||||
|
"Can not save '{url}'. You have probably reached the limit of active "
|
||||||
|
"sessions. Try later.".format(
|
||||||
|
url=_cleaned_url(self.url), text=response.text
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
m = re.search(
|
m = re.search(
|
||||||
r"https?://web.archive.org/web/([0-9]{14})/http", self._archive_url
|
r"https?://web.archive.org/web/([0-9]{14})/http", self._archive_url
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user