Skip to content

Commit 0fb2bc6

Browse files
committed
Remove ValidationError too.
1 parent 701b2ec commit 0fb2bc6

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

docs/creating.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,11 @@ Creating or Extending Validators
77
.. currentmodule:: jsonschema
88

99
.. autofunction:: validates
10+
11+
12+
Creating Validation Errors
13+
--------------------------
14+
15+
Any validating function that recurses into an instance (e.g. ``properties`` or
16+
``items``) must append to the :exc:`ValidationError.path` attribute of the
17+
error in order to properly maintain where in the instance the error occurred.

jsonschema.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,6 @@ def _validates(cls):
8989
return _validates
9090

9191

92-
class ValidationError(Exception):
93-
def __init__(self, message, validator=None, path=()):
94-
# Any validator that recurses (e.g. properties and items) must append
95-
# to the ValidationError's path to properly maintain where in the
96-
# instance the error occurred
97-
super(ValidationError, self).__init__(message, validator, path)
98-
self.message = message
99-
self.path = list(path)
100-
self.validator = validator
101-
102-
def __str__(self):
103-
return self.message
104-
105-
10692
@validates("draft3")
10793
class Draft3Validator(object):
10894
"""

0 commit comments

Comments
 (0)