Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning False in custom validation raising core error #64

Closed
hari44330 opened this issue Aug 18, 2016 · 1 comment
Closed

Returning False in custom validation raising core error #64

hari44330 opened this issue Aug 18, 2016 · 1 comment

Comments

@hari44330
Copy link

hari44330 commented Aug 18, 2016

Hello,

In custom validation function, when I return False I get the following error

File "/usr/local/lib/python2.7/dist-packages/pykwalify/core.py", line 238, in _handle_func
raise CoreError(u"Error when running extension function : {}".format(func))
pykwalify.errors.CoreError: <CoreError: error code 3: Error when running extension function : is_valid_ipv4: Path: '/'>

But it is working fine when I raise the assertion error. Is this expected behavior ?

File "/usr/local/lib/python2.7/dist-packages/pykwalify/core.py", line 234, in _handle_func
ret = method(value, rule, path)
File "/home/xxx/yaml/val.py", line 31, in is_valid_ipv4
raise AssertionError(ipError)
AssertionError: Invalid IP

Thanks
~Hari

@hari44330
Copy link
Author

I just found out that, it is the expected behavior. Sorry for the wrong alert

~Hari

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant