@@ -32,8 +32,8 @@ def __init__(self):
3232
3333 def entity (self , entity : _Entity ):
3434 if not isinstance (entity , _Entity ):
35- raise Exception (f"Given type is not an Entity ( { type (entity )} ) . "
36- f"Maybe did you forget the @Entity annotation? " )
35+ raise Exception (f"The given type is not an Entity: { type (entity )} . "
36+ f"Ensure to have an @Entity annotation on the class. " )
3737 for other_entity in self .entities : # Linear search (we should't have many entities)
3838 if entity .name == other_entity .name :
3939 raise Exception (f"Duplicate entity: \" { entity .name } \" " )
@@ -46,20 +46,20 @@ def validate_ids_assigned(self):
4646 for entity in self .entities :
4747 has_properties = len (entity .properties ) > 0
4848 if not entity .iduid .is_assigned ():
49- raise ValueError (f"Entity \" { entity .name } \" ID not assigned" )
49+ raise ValueError (f"Entity \" { entity .name } \" ID/UID not assigned" )
5050 for prop in entity .properties :
5151 if not prop .iduid .is_assigned ():
52- raise ValueError (f"Property \" { entity .name } .{ prop .name } \" ID not assigned" )
52+ raise ValueError (f"Property \" { entity .name } .{ prop .name } \" ID/UID not assigned" )
5353 if prop .index is not None :
5454 has_indices = True
5555 if not prop .index .iduid .is_assigned ():
56- raise ValueError (f"Property index \" { entity .name } .{ prop .name } \" ID not assigned" )
56+ raise ValueError (f"Property index \" { entity .name } .{ prop .name } \" ID/UID not assigned" )
5757 if has_properties and not entity .last_property_iduid .is_assigned ():
58- raise ValueError (f"Entity \" { entity .name } \" last_property_iduid not assigned" )
58+ raise ValueError (f"Entity \" { entity .name } \" last property ID/UID not assigned" )
5959 if has_entities and not self .last_entity_iduid .is_assigned ():
60- raise Exception ( "Model last_entity_iduid not assigned" )
60+ raise ValueError ( "Last entity ID/UID not assigned" )
6161 if has_indices and not self .last_index_iduid .is_assigned ():
62- raise ValueError ("Model last_index_iduid not assigned" )
62+ raise ValueError ("Last index ID/UID not assigned" )
6363
6464 def _set_hnsw_params (self , index : HnswIndex ):
6565 if index .dimensions is not None :
0 commit comments