-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Exceptions from QUIC APIs should derive from IOException #56954
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsFor one, exceptions from streams usually derive from IOException and QuicStream should follow this. But it also seems reasonable and consistent to have exceptions from QuicConnection/QuicListener derive from IOException as well. In particular, some exceptions are used for both QuicStream and QuicConnection. Related: #56292 (comment)
|
Precedent is mostly that |
The problem is that QuicStream derives from Stream, and in general Stream throws IOException. So at least for QuicStream, it seems like we should derive from IOException. so that code that is operating on a generic Stream can at least distinguish IOExceptions from other exceptions. That said, I don't know how consistent we are about this in general with Stream. Maybe it's not worth it. @stephentoub thoughts? |
I think it's fine to derive from IOException, though we can discuss it with API review when all of this comes through. There's a lot of antiquated exception derivation stemming from decisions 20 years ago, e.g. the closest existing counterpart to QuicException is probably SocketException, but we're obviously not going to make QuicException derive from Win32Exception or SystemException. There are plenty of exceptions that derive from IOException, and it is what's propagated from types like NetworkStream. |
What about any exceptions/errors related to invalid parameters? TLS/security/crypto related errors? I'm not sure all QUIC errors should be considered IOExceptions necessarily. But I guess it's more of a question: Does the base class of an exception reflect the type of exception or source of exception? |
Closing as covered by #70669 |
For one, exceptions from streams usually derive from IOException and QuicStream should follow this.
But it also seems reasonable and consistent to have exceptions from QuicConnection/QuicListener derive from IOException as well. In particular, some exceptions are used for both QuicStream and QuicConnection.
Related: #56292 (comment)
The text was updated successfully, but these errors were encountered: