diff --git a/docs/usage.rst b/docs/usage.rst index c633720..07becb8 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -8,7 +8,7 @@ Context Manager Either the Client or AsyncClient can be used as a ContextManager (or Async Context Manager) -.. code-block:: pythong +.. code-block:: python from healthchecks_io import AsyncClient, CheckCreate @@ -82,6 +82,7 @@ Pinging a Check ^^^^^^^^^^^^^^^ .. code-block:: python + from healthchecks_io import Client client = Client(api_key="myapikey") diff --git a/src/healthchecks_io/client/check_trap.py b/src/healthchecks_io/client/check_trap.py index bb04879..89bb040 100644 --- a/src/healthchecks_io/client/check_trap.py +++ b/src/healthchecks_io/client/check_trap.py @@ -153,13 +153,14 @@ class CheckTrap: Optional[bool]: self.suppress_exceptions, if true will not raise any exceptions """ if exc_type is None: - await self.client.success_ping( + # ignore typing, if we've gotten here we know its an async client + await self.client.success_ping( # type: ignore self.uuid, self.slug, data="\n".join(self.log_lines) ) else: self.add_log(str(exc)) self.add_log(str(traceback)) - await self.client.fail_ping( + await self.client.fail_ping( # type: ignore self.uuid, self.slug, data="\n".join(self.log_lines) ) return self.suppress_exceptions