-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Replace AssertionErrors with RuntimeExceptions #239
Comments
See suggestions from @dimas: |
Looks like there are still some instances of Error's in the code base such as UnexpectedFrameError, UnexpectedMethodError, and some places that throw a generic Error. Any chance those places could be switched to RuntimeExceptions too? For example there are a couple places that catch UnsupportedEncodingExceptions and wrap them in an Error. The code could be updated to use Charset.forName() which throws a runtime UnsupportedCharsetException. |
@vikinghawk we would definitely consider that for 5.0. Feel free to submit a PR against master. |
Fixed by 3c010f7. Thanks @vikinghawk ! |
Use e.g.
IllegalStateException
instead ofAssertionError
inBlockingCell
and other part of the code (when appropriate). TheError
family is too dramatic for this class and client code that tries to handle exceptions fromBlockingCell
could end up dealing with cases it cannot recover from anyway.Related to #237.
Reverse also the changes from #237, so the NIO loop doesn't actually handle
AssertionError
coming from elsewhere thanBlockingCell
.The text was updated successfully, but these errors were encountered: