diff --git a/vibora/schemas/extensions/fields.pyx b/vibora/schemas/extensions/fields.pyx index 037c250..574dfc0 100644 --- a/vibora/schemas/extensions/fields.pyx +++ b/vibora/schemas/extensions/fields.pyx @@ -97,7 +97,7 @@ cdef class Integer(Field): raise ValidationError(error_code=Messages.MUST_BE_INTEGER, field=self.load_from) try: return int(value) - except ValueError: + except (ValueError, TypeError): raise ValidationError(error_code=Messages.MUST_BE_INTEGER, field=self.load_from) @@ -115,7 +115,7 @@ cdef class Number(Field): raise ValidationError(error_code=Messages.MUST_BE_NUMBER, field=self.load_from) try: return float(value) - except ValueError: + except (ValueError, TypeError): raise ValidationError(error_code=Messages.MUST_BE_NUMBER, field=self.load_from)