@@ -96,7 +96,7 @@ def _get(d: Mapping[str, Any], expected_type: type[_T], key: str) -> _T | None:
9696def _get_required (d : Mapping [str , Any ], expected_type : type [_T ], key : str ) -> _T :
9797 """Get a required value from the dictionary and verify it's the expected type."""
9898 if (value := _get (d , expected_type , key )) is None :
99- raise PylockRequiredKeyError (key )
99+ raise _PylockRequiredKeyError (key )
100100 return value
101101
102102
@@ -150,7 +150,7 @@ def _get_required_as(
150150 """Get a required value from the dict, verify it's the expected type,
151151 and convert to the target type."""
152152 if (value := _get_as (d , expected_type , target_type , key )) is None :
153- raise PylockRequiredKeyError (key )
153+ raise _PylockRequiredKeyError (key )
154154 return value
155155
156156
@@ -209,7 +209,7 @@ def _get_required_sequence_of_objects(
209209 """Get a required list value from the dictionary and convert its items to a
210210 dataclass."""
211211 if (result := _get_sequence_of_objects (d , target_item_type , key )) is None :
212- raise PylockRequiredKeyError (key )
212+ raise _PylockRequiredKeyError (key )
213213 return result
214214
215215
@@ -263,7 +263,7 @@ def __str__(self) -> str:
263263 return self .message
264264
265265
266- class PylockRequiredKeyError (PylockValidationError ):
266+ class _PylockRequiredKeyError (PylockValidationError ):
267267 def __init__ (self , key : str ) -> None :
268268 super ().__init__ ("Missing required value" , context = key )
269269
0 commit comments