From 9a7764451790b492caffde2fe4639188fbd8253c Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Mon, 3 Jan 2022 11:16:48 +0200 Subject: [PATCH] Better sentry message when plan is not found --- lib/plausible/billing/plans.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/plausible/billing/plans.ex b/lib/plausible/billing/plans.ex index 274012238..c0a044c7b 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