Skip to content

Commit 3189f98

Browse files
authored
Merge pull request #7 from vsevolod-fedorov/master
Add actual_value argument to ArgumentValidationError
2 parents e98a627 + 3ff6f45 commit 3189f98

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pyvalid/__accepts.py

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ def __validate_args(self, func_name, args, kwargs):
140140
raise ArgumentValidationError(
141141
ord_num,
142142
func_name,
143+
value,
143144
accepted_values
144145
)
145146

pyvalid/__exceptions.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ class ArgumentValidationError(ValueError):
1515
"""Raised when the type of an argument to a function is not what it
1616
should be.
1717
"""
18-
def __init__(self, arg_num, func_name, accepted_arg_values):
19-
self.error = 'The {} argument of {}() is not in a {}'.format(
20-
arg_num, func_name, accepted_arg_values
18+
def __init__(self, arg_num, func_name, actual_value, accepted_arg_values):
19+
self.error = 'The {} argument of {}() is {} and not in a {}'.format(
20+
arg_num, func_name, actual_value, accepted_arg_values
2121
)
2222

2323
def __str__(self):

0 commit comments

Comments
 (0)