From b2e8300a4984fb1ff466ce2bf0775869fc91fd02 Mon Sep 17 00:00:00 2001 From: Sandy Spicer Date: Wed, 11 Sep 2024 03:39:10 -0700 Subject: [PATCH] chore: change funnel errors to ExposedHogQLError (#24822) --- posthog/clickhouse/client/execute_async.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/posthog/clickhouse/client/execute_async.py b/posthog/clickhouse/client/execute_async.py index 14e8cb4fae06d..88d479c8b331a 100644 --- a/posthog/clickhouse/client/execute_async.py +++ b/posthog/clickhouse/client/execute_async.py @@ -8,7 +8,7 @@ import sentry_sdk import structlog from prometheus_client import Histogram -from rest_framework.exceptions import NotFound +from rest_framework.exceptions import NotFound, APIException from posthog import celery, redis from posthog.clickhouse.client.async_task_chain import add_task_to_on_commit @@ -198,7 +198,7 @@ def execute_process_query( raise except Exception as err: query_status.results = None # Clear results in case they are faulty - if isinstance(err, ExposedHogQLError | ExposedCHQueryError) or is_staff_user: + if isinstance(err, APIException | ExposedHogQLError | ExposedCHQueryError) or is_staff_user: # We can only expose the error message if it's a known safe error OR if the user is PostHog staff query_status.error_message = str(err) logger.exception("Error processing query async", team_id=team_id, query_id=query_id, exc_info=True)