Remove ValidationError too.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user