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

Misuse RuntimeWarning exception? #72

Open
atugushev opened this issue Sep 18, 2022 · 0 comments
Open

Misuse RuntimeWarning exception? #72

atugushev opened this issue Sep 18, 2022 · 0 comments
Labels
question Further information is requested

Comments

@atugushev
Copy link
Collaborator

atugushev commented Sep 18, 2022

While RuntimeWarning is technically an exception, it should not be raised in code, because conceptually it belongs to the warnings mechanism.

async def decorator(cls: "NSQMessage", *args: Any, **kwargs: Any) -> Any:
if cls.is_processed:
raise RuntimeWarning("Message has already been processed")
response = await func(cls, *args, **kwargs)
return response

Originally posted by @atugushev in #28 (comment)

@atugushev atugushev added the question Further information is requested label Nov 7, 2022
@atugushev atugushev changed the title Misuse RuntimeWarning exception Misuse RuntimeWarning exception? Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant