Skip to content

Commit

Permalink
fix: catch Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki committed Oct 30, 2023
1 parent c701939 commit ba3d351
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions abuse_whois/services/whois.py
Expand Up @@ -7,6 +7,7 @@
from asyncwhois.errors import NotFoundError as WhoIsNotFoundError
from asyncwhois.pywhois import DomainLookup, NumberLookup
from httpx._exceptions import TimeoutException
from loguru import logger
from returns.functions import raise_exception
from returns.future import FutureResultE, future_safe
from returns.pipeline import flow
Expand Down Expand Up @@ -47,8 +48,9 @@ async def domain_query(
except (TimeoutException, WhodapError, ssl.SSLError):
# fallback to whois
pass
except (TypeError, NotImplementedError):
pass
except Exception as e:
# also fallback to whois
logger.exception(e)

# fallback to whois
lookup = await DomainLookup.aio_whois_domain(
Expand Down

0 comments on commit ba3d351

Please sign in to comment.