diff --git a/posthog/api/mixins.py b/posthog/api/mixins.py index a23a2424b30bf..69b83d3469e01 100644 --- a/posthog/api/mixins.py +++ b/posthog/api/mixins.py @@ -3,6 +3,7 @@ from pydantic import BaseModel, ValidationError from rest_framework.exceptions import ParseError +from sentry_sdk import capture_exception T = TypeVar("T", bound=BaseModel) @@ -12,4 +13,5 @@ def get_model(self, data: dict, model: Type[T]) -> T: try: return model.model_validate(data) except ValidationError as exc: + capture_exception(exc) raise ParseError("JSON parse error - %s" % str(exc))