Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke on_error_handler as described in the docs #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Invoke on_error_handler as described in the docs
According to the example in the README, the `on_error` handler should be
called with two parameters, of which the first is the `CertStreamClient`
instance:

https://github.com/CaliDog/certstream-python/blob/97eb5b37e2c2077495e20d6df3459088a5262b48/README.md?plain=1#L61-L63
dlenskiSB committed Jun 13, 2024
commit b5fa9d6f5fda52861ed9940916be7b274735e102
2 changes: 1 addition & 1 deletion certstream/core.py
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ def _on_error(self, _, ex):
if type(ex) == KeyboardInterrupt:
raise
if self.on_error_handler:
self.on_error_handler(ex)
self.on_error_handler(self, ex)
certstream_logger.error("Error connecting to CertStream - {} - Sleeping for a few seconds and trying again...".format(ex))

def listen_for_events(message_callback, url, skip_heartbeats=True, setup_logger=True, on_open=None, on_error=None, **kwargs):