certstream-python
certstream-python copied to clipboard
Minor mistake in the README
Hi, I noticed a minor mistake in the readme, the on_error function only takes a single exception argument (because it reimplements it and doesn't only callback the WebSocketClient on_error function).
Here is the correct code example that should be in the README:
import certstream
def print_callback(message, context):
print("Received messaged -> {}".format(message))
def on_open():
print("Connection successfully established!")
def on_error(exception):
# Instance is the CertStreamClient instance that barfed
print("Exception in CertStreamClient! -> {}".format(exception))
certstream.listen_for_events(print_callback, on_open=on_open, on_error=on_error, url='wss://certstream.calidog.io/')
(happy to do a PR if needed)