Skip to content

Commit fca2f1b

Browse files
author
Christian Hergert
committed
cursor: set error on currupted result document.
1 parent 408cc26 commit fca2f1b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/mongoc/mongoc-cursor.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,10 @@ _mongoc_cursor_unwrap_failure (mongoc_cursor_t *cursor)
432432
RETURN (true);
433433
}
434434
} else {
435+
bson_set_error (&cursor->error,
436+
MONGOC_ERROR_BSON,
437+
MONGOC_ERROR_BSON_INVALID,
438+
"Failed to decode document from the server.");
435439
RETURN (true);
436440
}
437441
}

0 commit comments

Comments
 (0)