fix: improve regex error handling in CreateFunnelPage by providing specific step names in error messages
This commit is contained in:
@@ -57,8 +57,9 @@ export default function CreateFunnelPage() {
|
|||||||
toast.error('Please enter a path for all steps')
|
toast.error('Please enter a path for all steps')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (steps.some(s => s.type === 'regex' && !isValidRegex(s.value))) {
|
const invalidRegexStep = steps.find(s => s.type === 'regex' && !isValidRegex(s.value))
|
||||||
toast.error('Invalid regex in one or more steps. Check the pattern for steps with type "regex".')
|
if (invalidRegexStep) {
|
||||||
|
toast.error(`Invalid regex pattern in step: ${invalidRegexStep.name}`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user