Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Better sentry message when plan is not found

Uku Taht9a7764451790
diff --git a/lib/plausible/billing/plans.ex b/lib/plausible/billing/plans.ex
index 274012238d..c0a044c7b4 100644
--- a/lib/plausible/billing/plans.ex
+++ b/lib/plausible/billing/plans.ex
@@ -99,7 +99,11 @@ defmodule Plausible.Billing.Plans do
enterprise_plan =
Repo.get_by(Plausible.Billing.EnterprisePlan, user_id: subscription.user_id)
- enterprise_plan && enterprise_plan.monthly_pageview_limit
+ if enterprise_plan do
+ enterprise_plan.monthly_pageview_limit
+ else
+ Sentry.capture_message("Unknown allowance for plan", extra: %{subscription: subscription})
+ end
end
end