| | 1 | | // Copyright (c) ZeroC, Inc. |
| | 2 | |
|
| | 3 | | using System.Net.Sockets; |
| | 4 | |
|
| | 5 | | namespace IceRpc.Transports.Tcp.Internal; |
| | 6 | |
|
| | 7 | | internal static class IOExceptionExtensions |
| | 8 | | { |
| | 9 | | /// <summary>Converts an IOException into an <see cref="IceRpcException" />.</summary> |
| | 10 | | internal static IceRpcException ToIceRpcException(this IOException exception) => |
| 20 | 11 | | exception.InnerException is SocketException socketException ? |
| 20 | 12 | | socketException.ToIceRpcException(exception) : |
| 20 | 13 | | new IceRpcException(IceRpcError.IceRpcError, exception); |
| | 14 | | } |