Skip to content

Commit ffdacbd

Browse files
committed
code review
1 parent cb25435 commit ffdacbd

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

posthog/client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,12 @@ def _load_feature_flags(self):
607607
self.feature_flags_by_key = {}
608608
self.group_type_mapping = {}
609609
self.cohorts = {}
610+
611+
if self.debug:
612+
raise APIError(
613+
status=402,
614+
message="PostHog feature flags quota limited",
615+
)
610616
else:
611617
self.log.error(f"[FEATURE FLAGS] Error loading feature flags: {e}")
612618
except Exception as e:

posthog/request.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ def _process_response(
7070
log.debug(success_message)
7171
response = res.json() if return_json else res
7272
# Handle quota limited decide responses by raising a specific error
73+
# NB: other services also put entries into the quotaLimited key, but right now we only care about feature flags
74+
# since most of the other services handle quota limiting in other places in the application.
7375
if (
7476
isinstance(response, dict)
7577
and "quotaLimited" in response

0 commit comments

Comments
 (0)