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

How to catch exceptions from subscriber? #15

Open
Undertone0809 opened this issue Jul 22, 2023 · 0 comments
Open

How to catch exceptions from subscriber? #15

Undertone0809 opened this issue Jul 22, 2023 · 0 comments

Comments

@Undertone0809
Copy link
Owner

Undertone0809 commented Jul 22, 2023

How to catch exceptions from sub threads and stop the main thread? Does anyone have an idea?

As you can see the following demo, how can we prevent the last line of code from not executing?

from broadcast_service import broadcast_service


@broadcast_service.on_listen("test")
def handle_rec():
    raise Exception("This is a error")


broadcast_service.publish("test")
print("Here can not be work.")
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