@@ -100,7 +100,7 @@ def __init__(self, database: AsyncDatabase, collection: str = "fs"):
100100 .. seealso:: The MongoDB documentation on `gridfs <https://dochub.mongodb.org/core/gridfs>`_.
101101 """
102102 if not isinstance (database , AsyncDatabase ):
103- raise TypeError ("database must be an instance of Database" )
103+ raise TypeError (f "database must be an instance of Database, not { type ( database ) } " )
104104
105105 database = _clear_entity_type_registry (database )
106106
@@ -503,7 +503,7 @@ def __init__(
503503 .. seealso:: The MongoDB documentation on `gridfs <https://dochub.mongodb.org/core/gridfs>`_.
504504 """
505505 if not isinstance (db , AsyncDatabase ):
506- raise TypeError ("database must be an instance of AsyncDatabase" )
506+ raise TypeError (f "database must be an instance of AsyncDatabase, not { type ( db ) } " )
507507
508508 db = _clear_entity_type_registry (db )
509509
@@ -1082,7 +1082,7 @@ def __init__(
10821082 :attr:`~pymongo.collection.AsyncCollection.write_concern`
10831083 """
10841084 if not isinstance (root_collection , AsyncCollection ):
1085- raise TypeError ("root_collection must be an instance of AsyncCollection" )
1085+ raise TypeError (f "root_collection must be an instance of AsyncCollection, not { type ( root_collection ) } " )
10861086
10871087 if not root_collection .write_concern .acknowledged :
10881088 raise ConfigurationError ("root_collection must use acknowledged write_concern" )
@@ -1436,7 +1436,7 @@ def __init__(
14361436 from the server. Metadata is fetched when first needed.
14371437 """
14381438 if not isinstance (root_collection , AsyncCollection ):
1439- raise TypeError ("root_collection must be an instance of AsyncCollection" )
1439+ raise TypeError (f "root_collection must be an instance of AsyncCollection, not { type ( root_collection ) } " )
14401440 _disallow_transactions (session )
14411441
14421442 root_collection = _clear_entity_type_registry (root_collection )
0 commit comments