File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,12 @@ mongoc_client_connect_tcp (const mongoc_uri_t *uri,
141
141
rp -> ai_addr ,
142
142
(socklen_t )rp -> ai_addrlen ,
143
143
expire_at )) {
144
+ char errmsg [32 ];
145
+
146
+ bson_strerror_r (mongoc_socket_errno (sock ), errmsg , sizeof errmsg );
147
+ MONGOC_WARNING ("Failed to connect, error: %d, %s\n" ,
148
+ mongoc_socket_errno (sock ),
149
+ errmsg );
144
150
mongoc_socket_destroy (sock );
145
151
sock = NULL ;
146
152
continue ;
@@ -153,7 +159,8 @@ mongoc_client_connect_tcp (const mongoc_uri_t *uri,
153
159
bson_set_error (error ,
154
160
MONGOC_ERROR_STREAM ,
155
161
MONGOC_ERROR_STREAM_CONNECT ,
156
- "Failed to connect to target host." );
162
+ "Failed to connect to target host: %s" ,
163
+ host -> host_and_port );
157
164
freeaddrinfo (result );
158
165
RETURN (NULL );
159
166
}
You can’t perform that action at this time.
0 commit comments