1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-07-07 11:42:38 +02:00

List all Exceptions in doc, fix name inconsistcies

This commit is contained in:
Alexander Graf 2018-03-18 16:29:34 +01:00
parent b2f31e7782
commit 279de0a641
2 changed files with 7 additions and 3 deletions

View File

@ -100,6 +100,8 @@ Exceptions
.. autoexception:: QueryReturnedNotFoundException
.. autoexception:: QueryReturnedForbiddenException
.. autoexception:: ProfileNotExistsException
.. autoexception:: ProfileHasNoPicsException
@ -115,3 +117,5 @@ Exceptions
.. autoexception:: BadCredentialsException
.. autoexception:: ConnectionException
.. autoexception:: TooManyRequestsException

View File

@ -89,7 +89,7 @@ class ConnectionException(InstaloaderException):
pass
class TooManyRequests(ConnectionException):
class TooManyRequestsException(ConnectionException):
pass
@ -613,7 +613,7 @@ class Instaloader:
if resp.status_code == 404:
raise QueryReturnedNotFoundException("404")
if resp.status_code == 429:
raise TooManyRequests("429 - Too Many Requests")
raise TooManyRequestsException("429 - Too Many Requests")
if resp.status_code != 200:
raise ConnectionException("HTTP error code {}.".format(resp.status_code))
resp_json = resp.json()
@ -633,7 +633,7 @@ class Instaloader:
"Please do not use Instagram in your browser or run multiple instances of Instaloader "
"in parallel.")
try:
if isinstance(err, TooManyRequests):
if isinstance(err, TooManyRequestsException):
print(textwrap.fill(text_for_429), file=sys.stderr)
if is_graphql_query:
waittime = graphql_query_waittime(query_id=params['query_id'], untracked_queries=True)