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

Minor mistake in the README #66

Open
Te-k opened this issue Jul 22, 2024 · 0 comments
Open

Minor mistake in the README #66

Te-k opened this issue Jul 22, 2024 · 0 comments

Comments

@Te-k
Copy link

Te-k commented Jul 22, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant