Remove ValidationError too.

This commit is contained in:
Julian Berman
2013-02-16 23:59:03 -05:00
parent 701b2ecfcd
commit 0fb2bc6f96
2 changed files with 8 additions and 14 deletions

View File

@@ -7,3 +7,11 @@ Creating or Extending Validators
.. currentmodule:: jsonschema
.. autofunction:: validates
Creating Validation Errors
--------------------------
Any validating function that recurses into an instance (e.g. ``properties`` or
``items``) must append to the :exc:`ValidationError.path` attribute of the
error in order to properly maintain where in the instance the error occurred.

View File

@@ -89,20 +89,6 @@ def validates(version):
return _validates
class ValidationError(Exception):
def __init__(self, message, validator=None, path=()):
# Any validator that recurses (e.g. properties and items) must append
# to the ValidationError's path to properly maintain where in the
# instance the error occurred
super(ValidationError, self).__init__(message, validator, path)
self.message = message
self.path = list(path)
self.validator = validator
def __str__(self):
return self.message
@validates("draft3")
class Draft3Validator(object):
"""