-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
python-engineio erroneously ignores ValueError exceptions from applications #44
Comments
I think you need to read up on Exceptions more. Crashes raise exceptions, that's true, but exceptions are also used as a signaling mechanism, which is the case in this snippet of code you are indicated, which receives a signal from https://github.com/miguelgrinberg/python-engineio/blob/master/engineio/asyncio_socket.py#L47. |
Oh. I see. Interesting. Insulting your users by insinuating they don't know how Python. I know what exceptions are. I've used Python for a decade. This one is called Value Error, and as the name suggests, is meant to signal one thing: errors. Co-opting Python's most common exception type to mean "unhandled WebSocket packet type" seems ill-conceived, especially considering the user very likely wants to know when packets are being dropped. All in all, a pretty bad way to deal with the problem. More so, if your user's code errors with that exception type, which is raised by basically every single library both standard and PyPI, your library simply silences it -- because it might mean the last WebSocket packet's type isn't recognized by the library. I urge you to rethink this design. |
I did not mean to insult you. You suggested I was suppressing Have you found a situation in which a |
Sure, just raise a |
I'm using |
Again though, I'm not familiar enough with the internals of the code to know, but silencing unrecognized packet types seems like trouble down the line. I think emitting a warning log message for unrecognized packet types seems more fitting. |
Oh, now I see what you mean, I was missing the context to understand what you meant. |
I'm sorry, I was perhaps not very clear. 😄 Happy we're on the same page. |
People generally want to know when their code crashes. However, https://github.com/miguelgrinberg/python-engineio/blob/master/engineio/asyncio_socket.py#L182 explicitly ignores ValueErrors. There is no rationale, there is no explanation. Please remove this ASAP.
The text was updated successfully, but these errors were encountered: