Skip to content

Commit

Permalink
extend capture endpoint utils to include new type of error
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarticus committed Aug 5, 2024
1 parent 2645397 commit 5a0b0ed
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions posthog/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
from statshog.defaults.django import statsd

from posthog.constants import EventDefinitionType
from posthog.exceptions import RequestParsingError, generate_exception_response
from posthog.exceptions import (
RequestParsingError,
UnspecifiedCompressionFallbackParsingError,
generate_exception_response,
)
from posthog.models import Entity, EventDefinition
from posthog.models.entity import MathType
from posthog.models.filters.filter import Filter
Expand Down Expand Up @@ -182,7 +186,7 @@ def get_data(request):
data = None
try:
data = load_data_from_request(request)
except RequestParsingError as error:
except (RequestParsingError, UnspecifiedCompressionFallbackParsingError) as error:
statsd.incr("capture_endpoint_invalid_payload")
logger.exception(f"Invalid payload", error=error)
return (
Expand Down

0 comments on commit 5a0b0ed

Please sign in to comment.