From 0c09c5b97eadbec6c21005f7e2e0fec40337e052 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Wed, 4 Feb 2026 23:54:44 +0100 Subject: [PATCH] fix: improve regex error handling in CreateFunnelPage by providing specific step names in error messages --- app/sites/[id]/funnels/new/page.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/sites/[id]/funnels/new/page.tsx b/app/sites/[id]/funnels/new/page.tsx index c4e9990..30aa77b 100644 --- a/app/sites/[id]/funnels/new/page.tsx +++ b/app/sites/[id]/funnels/new/page.tsx @@ -57,8 +57,9 @@ export default function CreateFunnelPage() { toast.error('Please enter a path for all steps') return } - if (steps.some(s => s.type === 'regex' && !isValidRegex(s.value))) { - toast.error('Invalid regex in one or more steps. Check the pattern for steps with type "regex".') + const invalidRegexStep = steps.find(s => s.type === 'regex' && !isValidRegex(s.value)) + if (invalidRegexStep) { + toast.error(`Invalid regex pattern in step: ${invalidRegexStep.name}`) return }