Skip to content

Commit d7c48a8

Browse files
committed
Changed to a more appropriate exception type
As recommend by @gmarz changed from a generic exception to a transport type exception.
1 parent 370662a commit d7c48a8

File tree

1 file changed

+2
-2
lines changed
  • src/Connections/Elasticsearch.Net.Connection.Thrift/Transport

1 file changed

+2
-2
lines changed

src/Connections/Elasticsearch.Net.Connection.Thrift/Transport/TSocket.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ public override void Open()
117117
{
118118
InitSocket();
119119
}
120+
120121

121122
var connectionRequest = client.BeginConnect(host, port, null, null);
122-
123123
var connected = connectionRequest.AsyncWaitHandle.WaitOne(timeout);
124124

125125
if (!connected)
126126
{
127-
throw new Exception("Failed to connect");
127+
throw new TTransportException("Failed to connect");
128128
}
129129

130130
inputStream = client.GetStream();

0 commit comments

Comments
 (0)