diff --git a/src/validators/between.py b/src/validators/between.py index b37f164c..108c9578 100644 --- a/src/validators/between.py +++ b/src/validators/between.py @@ -53,10 +53,7 @@ def between( Returns: (Literal[True]): If `value` is in between the given conditions. (ValidationError): If `value` is not in between the given conditions. - - Raises: - (ValueError): If `min_val` is greater than `max_val`. - (TypeError): If there's a type mismatch during comparison. + (ValidationError): If `min_val` is greater than `max_val` or the values cannot be compared. Note: - `PossibleValueTypes` = `TypeVar("PossibleValueTypes", int, float, str, datetime, None)` diff --git a/src/validators/domain.py b/src/validators/domain.py index ee6db4e7..55847fe7 100644 --- a/src/validators/domain.py +++ b/src/validators/domain.py @@ -87,9 +87,7 @@ def domain( Returns: (Literal[True]): If `value` is a valid domain name. (ValidationError): If `value` is an invalid domain name. - - Raises: - (UnicodeError): If `value` cannot be encoded into `idna` or decoded into `utf-8`. + (ValidationError): If `value` cannot be encoded into `idna` or decoded into `utf-8`. """ if not value: return False diff --git a/src/validators/length.py b/src/validators/length.py index e49091d4..f8057b86 100644 --- a/src/validators/length.py +++ b/src/validators/length.py @@ -33,9 +33,7 @@ def length(value: str, /, *, min_val: Union[int, None] = None, max_val: Union[in Returns: (Literal[True]): If `len(value)` is in between the given conditions. (ValidationError): If `len(value)` is not in between the given conditions. - - Raises: - (ValueError): If either `min_val` or `max_val` is negative. + (ValidationError): If either `min_val` or `max_val` is negative. """ if min_val is not None and min_val < 0: raise ValueError("Length cannot be negative. `min_val` is less than zero.")