pyvalid
pyvalid copied to clipboard
Design to support customized messages in exceptions and warnings
Currently when a exception is raised, the error message does not specify which exact validation method failed.
This code change allows the user to add customized messages to the exceptions, which also include the method name where failure occurred.
is_valid variable is converted into a class called IsValid.
Also, user can choose to just raise warning instead of exception by setting the is_warning flag to True.