Skip to content

Commit 62b8d9e

Browse files
committed
Handle ValueError in mashmallow validation
Part of: #859
1 parent c37a2e6 commit 62b8d9e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hug/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ def __call__(self, value):
727727
value = self.schema.dump(value)
728728
except ValidationError as e:
729729
errors = e.messages
730+
except ValueError as e:
731+
errors = [str(e)]
730732

731733
if errors:
732734
raise InvalidTypeData(

0 commit comments

Comments
 (0)