certstream-python icon indicating copy to clipboard operation
certstream-python copied to clipboard

Minor mistake in the README

Open Te-k opened this issue 7 months ago • 0 comments

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)

Te-k avatar Jul 22 '24 11:07 Te-k