feat(Channel): Remove checked exception from interface Channel.abort(...) as it should silently discard any exceptions #1039
+71
−23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Changes
As proposed in #434, I eliminated the "throws" clause from the Channel.abort(...) interface in order to align with the desired behaviour, which is also document above the method definitions:
Any encountered exceptions in the close operation are silently discarded.
At the current time, consumers calling the abort(...) method will have to manually check for IOException by using a try-catch-block, which is obsolete and just unnecessarily blows up code.
Types of Changes
As already mentioned inside #434:
This is a breaking change though (code catching the IOException won't compile anymore), so it must go into 6.0.
Checklist
CONTRIBUTING.md
documentFurther Comments
It seems as there are no existing tests for class
AutorecoveringChannel
. This might be something that could be improved in the future. I just added some initial tests for the abort methods.