Skip to content

Commit

Permalink
add other throwable errors into except
Browse files Browse the repository at this point in the history
getting post can throw other errors
  • Loading branch information
kytpbs committed Aug 27, 2024
1 parent 66dfaa1 commit 27086e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/instagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pathlib import Path

from dotenv import load_dotenv
from instaloader import ConnectionException, LoginException
from instaloader import ConnectionException, LoginException, QueryReturnedBadRequestException
from instaloader.instaloader import Instaloader
from instaloader.structures import Post

Expand Down Expand Up @@ -101,7 +101,7 @@ def _get_post_from_url(url: str) -> Post | None:
return None
try:
return Post.from_shortcode(downloader.context, shortcode)
except ConnectionException as e: # probably graphql error
except (ConnectionException, QueryReturnedBadRequestException) as e: # probably graphql error
logging.exception(e)
return None

Expand Down

0 comments on commit 27086e6

Please sign in to comment.