You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proposing that we create an exception that can be raised in a validator, which indicates an Invalid state AND stops the validation chain. I have something hacked together which accomplishes this:
classComboBreaker(colander.Invalid):
passclassAll(colander.All):
""" Custom All validator, that allows me to throw a specific exception, if I want to end the validation chain. """def__call__(self, node, value):
excs= []
forvalidatorinself.validators:
try:
validator(node, value)
exceptComboBreakerase:
excs.append(e)
breakexceptInvalidase:
excs.append(e)
ifexcs:
exc=Invalid(node, [exc.msgforexcinexcs])
foreinexcs:
exc.children.extend(e.children)
raiseexc
The text was updated successfully, but these errors were encountered:
Proposing that we create an exception that can be raised in a validator, which indicates an Invalid state AND stops the validation chain. I have something hacked together which accomplishes this:
The text was updated successfully, but these errors were encountered: