fix(frontend): improve waitlist error display for users not on allowlist (#11198)

fix issue with identifying errors :(
### Changes 🏗️

<!-- Concisely describe all of the changes made in this pull request:
-->

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  <!-- Put your test plan here: -->
- [x] we have to test in dev due to waitlist integration, so we are
merging. will revert if fails

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
This commit is contained in:
Nicholas Tindle
2025-10-18 00:14:05 -05:00
committed by GitHub
parent 097a19141d
commit 3f546ae845

View File

@@ -10,6 +10,8 @@
export function isWaitlistError(error: any): boolean {
if (!error?.message) return false;
if (error?.code === "P0001") return true;
return (
error.message.includes("P0001") || // PostgreSQL custom error code
error.message.includes("not allowed to register") || // Trigger message
@@ -33,6 +35,8 @@ export function isWaitlistErrorFromParams(
): boolean {
if (!errorDescription) return false;
if (errorCode === "P0001") return true;
const description = errorDescription.toLowerCase();
return (
description.includes("p0001") || // PostgreSQL error code might be in description