Open dlenskiSB opened 5 months ago
In addition to aligning the docs with the code, this fix is needed to be able to construct a CertStreamClient
object with an error handler that actually has access to the instance object.
Currently, I have to do this by modifying the .on_error_handler
after construction:
from functools import partial
def on_error_handler(instance, exc):
# ...
# FIXME: Docs say instance is passed as first param, but it isn't
c = CertStreamClient(callback, url='wss://certstream.calidog.io/', skip_heartbeats=True)
c.on_error_handler = partial(on_error_handler, c)
According to the example in the README, the
on_error
handler should be called with two parameters, of which the first is theCertStreamClient
instance:https://github.com/CaliDog/certstream-python/blob/97eb5b37e2c2077495e20d6df3459088a5262b48/README.md?plain=1#L61-L63