Skip to content

Commit 9cf1be7

Browse files
author
Emile Joubert
committed
Catch exceptions more specifically
1 parent e8b59ac commit 9cf1be7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

projects/client/RabbitMQ.Client/src/client/impl/SocketFrameHandler_0_9.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ private void Connect(TcpClient socket, AmqpTcpEndpoint endpoint, int timeout)
117117
}
118118
socket.EndConnect(ar);
119119
}
120-
catch (TimeoutException)
120+
catch (ArgumentException e)
121121
{
122-
throw;
122+
throw new ConnectFailureException("Connection failed", e);
123123
}
124-
catch (Exception e)
124+
catch (SocketException e)
125125
{
126126
throw new ConnectFailureException("Connection failed", e);
127127
}

0 commit comments

Comments
 (0)