Skip to content

Commit 025ff65

Browse files
committed
More explicit validation error with field name
1 parent bb21dbb commit 025ff65

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* better documentation of connection class
1010
* False is not considered a Null value while validating
1111
* Removed redundant document creation functions
12+
* More explicit validation error with field name
1213

1314
1.3.4
1415
=====

pyArango/document.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ def validateField(self, field):
6565
return self[field].validate()
6666

6767
if field in self.patchStore:
68-
return self.validators[field].validate(self.patchStore[field])
68+
try:
69+
return self.validators[field].validate(self.patchStore[field])
70+
except ValidationError as e:
71+
raise ValidationError( "'%s' -> %s" % ( field, str(e)) )
6972
else:
7073
try:
7174
return self.validators[field].validate(self.store[field])

0 commit comments

Comments
 (0)