Skip to content

Commit

Permalink
chore(queries): capture parse errors (#19987)
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr authored Jan 26, 2024
1 parent 8e8e483 commit 859b2bd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions posthog/api/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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))

0 comments on commit 859b2bd

Please sign in to comment.