Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
A.Shpak committed Mar 21, 2024
1 parent f80144f commit b7d0f8f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions chatushka/_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from types import TracebackType
from typing import Any, Literal

from httpx import AsyncClient, RequestError, Response
from httpx import AsyncClient, Response, TimeoutException

from chatushka._constants import HTTP_REGULAR_TIMEOUT
from chatushka._errors import ChatushkaResponseError
Expand All @@ -15,6 +15,7 @@
Message,
Update,
)
from chatushka._sentry import report_exc


async def _raise_on_api_error_response_event_hook(
Expand Down Expand Up @@ -101,8 +102,11 @@ async def get_updates(
api_method="getUpdates",
**params,
)
except RequestError as exc:
logger.info(f"{self} <<< {exc!s}")
except TimeoutException:
return [], offset
except Exception as exc:
report_exc(exc)
logger.error(f"{self} !!! {exc.__class__.__name__} ({exc!s})")
return [], offset
results = [Update.model_validate(entry) for entry in response]
if results:
Expand Down

0 comments on commit b7d0f8f

Please sign in to comment.