Skip to content

Commit

Permalink
ignore all exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr committed Jan 2, 2025
1 parent f950df6 commit f71e331
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions posthog/api/insight.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
from functools import lru_cache
import logging
from typing import Any, Optional, Union, cast

import posthoganalytics
Expand Down Expand Up @@ -173,17 +174,21 @@ def log_and_report_insight_activity(


def capture_legacy_api_call(request: request.Request, team: Team):
event = "legacy insight endpoint called"
distinct_id: str = request.user.distinct_id # type: ignore
properties = {
"path": request._request.path,
"method": request._request.method,
"use_hogql": False,
"filter": get_filter(request=request, team=team),
"was_impersonated": is_impersonated_session(request),
}

posthoganalytics.capture(distinct_id, event, properties, groups=(groups(team.organization, team)))
try:
event = "legacy insight endpoint called"
distinct_id: str = request.user.distinct_id # type: ignore
properties = {
"path": request._request.path,
"method": request._request.method,
"use_hogql": False,
"filter": get_filter(request=request, team=team),
"was_impersonated": is_impersonated_session(request),
}

posthoganalytics.capture(distinct_id, event, properties, groups=(groups(team.organization, team)))
except Exception as e:
logging.exception(f"Error in capture_legacy_api_call: {e}")
pass


class QuerySchemaParser(JSONParser):
Expand Down

0 comments on commit f71e331

Please sign in to comment.