Skip to content

Commit 48b6847

Browse files
committed
Include host:port in cluster internal errors.
1 parent 73f04b8 commit 48b6847

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/mongoc/mongoc-cluster.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,8 +1261,7 @@ server_description_not_found (uint32_t server_id,
12611261
}
12621262

12631263
static void
1264-
node_not_found (uint32_t server_id,
1265-
mongoc_server_description_t *sd,
1264+
node_not_found (mongoc_server_description_t *sd,
12661265
bson_error_t *error /* OUT */)
12671266
{
12681267
if (sd->error.code) {
@@ -1271,13 +1270,13 @@ node_not_found (uint32_t server_id,
12711270
bson_set_error (error,
12721271
MONGOC_ERROR_STREAM,
12731272
MONGOC_ERROR_STREAM_NOT_ESTABLISHED,
1274-
"Could not find node %u", server_id);
1273+
"Could not find node %s",
1274+
sd->host.host_and_port);
12751275
}
12761276
}
12771277

12781278
static void
1279-
stream_not_found (uint32_t server_id,
1280-
mongoc_server_description_t *sd,
1279+
stream_not_found (mongoc_server_description_t *sd,
12811280
bson_error_t *error /* OUT */)
12821281
{
12831282
if (sd->error.code) {
@@ -1286,7 +1285,8 @@ stream_not_found (uint32_t server_id,
12861285
bson_set_error (error,
12871286
MONGOC_ERROR_STREAM,
12881287
MONGOC_ERROR_STREAM_NOT_ESTABLISHED,
1289-
"Could not find stream for node %u", server_id);
1288+
"Could not find stream for node %s",
1289+
sd->host.host_and_port);
12901290
}
12911291
}
12921292

@@ -1380,7 +1380,7 @@ mongoc_cluster_fetch_stream_single (mongoc_cluster_t *cluster,
13801380

13811381
if (!stream) {
13821382
if (!reconnect_ok) {
1383-
stream_not_found (sd->id, sd, error);
1383+
stream_not_found (sd, error);
13841384
return NULL;
13851385
}
13861386

@@ -1440,7 +1440,7 @@ mongoc_cluster_fetch_stream_pooled (mongoc_cluster_t *cluster,
14401440

14411441
/* no node, or out of date */
14421442
if (!reconnect_ok) {
1443-
node_not_found (sd->id, sd, error);
1443+
node_not_found (sd, error);
14441444
return NULL;
14451445
}
14461446

0 commit comments

Comments
 (0)