Simplify catch-rethrow logic in NetworkStream (#44246)
authorAnton Firszov <Anton.Firszov@microsoft.com>
Fri, 6 Nov 2020 13:52:49 +0000 (14:52 +0100)
committerGitHub <noreply@github.com>
Fri, 6 Nov 2020 13:52:49 +0000 (14:52 +0100)
commitd54791648ee99bb36ac86d83568e155f19a67486
tree514ed2ac6bfa1667f016d6e77dd2a96b199cb0b4
parenta6835438581730da23fb3d4eea7ea7c4af1b00a3
Simplify catch-rethrow logic in NetworkStream (#44246)

A follow-up on #40772 (comment), simplifies and harmonizes the way we wrap exceptions into IOException. Having one catch block working with System.Exception seems to be enough here, no need for specific handling of SocketException.
src/libraries/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs
src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs