mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user