From 838e066dbdf69d06ce2ea5dd201c1bafa2fca344 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Wed, 20 May 2026 10:55:25 +0530 Subject: [PATCH 1/3] feat: add dedicated 402 budget limit error page Replace generic error display for 402 responses with a dedicated budget limit error page. Includes a 'Go to billing' CTA when an organization is in context, and a 'Change organization' secondary action on both console-level and project-level error pages. --- src/routes/(console)/+error.svelte | 75 +++++++++++++++---- .../project-[region]-[project]/+error.svelte | 36 ++++++++- 2 files changed, 95 insertions(+), 16 deletions(-) diff --git a/src/routes/(console)/+error.svelte b/src/routes/(console)/+error.svelte index 41863e61a4..ec00cecb1a 100644 --- a/src/routes/(console)/+error.svelte +++ b/src/routes/(console)/+error.svelte @@ -5,7 +5,12 @@ import { Button } from '$lib/elements/forms'; import { isVerifyEmailRedirectError } from '$lib/helpers/emailVerification'; import { Container } from '$lib/layout'; - import { Typography } from '@appwrite.io/pink-svelte'; + import { Badge, Layout, Typography } from '@appwrite.io/pink-svelte'; + + const isPaymentError = $derived(page.status === 402); + const billingUrl = $derived( + page.params.organization ? `${base}/organization-${page.params.organization}/billing` : null + ); $effect(() => { const verifyEmailPath = resolve('/verify-email'); @@ -15,15 +20,59 @@ }); - -
- {'status' in page.error - ? page.error.status || 'Invalid Argument' - : 'Invalid Argument'} - {page.error.message} -
-
- -
-
+{#if isPaymentError} +
+
+ + + + + Your organization has reached its budget limit + + + Access to resources has been blocked. Update your billing settings to + restore access. + + +
+ + {#if billingUrl} + + {/if} + + +
+
+
+
+{:else} + +
+ {'status' in page.error + ? page.error.status || 'Invalid Argument' + : 'Invalid Argument'} + {page.error.message} +
+
+ +
+
+{/if} + + diff --git a/src/routes/(console)/project-[region]-[project]/+error.svelte b/src/routes/(console)/project-[region]-[project]/+error.svelte index 602d883377..ab7473aa10 100644 --- a/src/routes/(console)/project-[region]-[project]/+error.svelte +++ b/src/routes/(console)/project-[region]-[project]/+error.svelte @@ -1,12 +1,12 @@ -{#if page.error.type === 'general_resource_blocked'} +{#if isPaymentError} +
+
+ + + + + Your organization has reached its budget limit + + + Access to this resource has been blocked. Update your billing settings to + restore access. + + +
+ + {#if billingUrl} + + {/if} + + +
+
+
+
+{:else if page.error.type === 'general_resource_blocked'}
From 549c073aa604fef9e00f2ef586b3cd4fdc23d18b Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Wed, 20 May 2026 11:03:53 +0530 Subject: [PATCH 2/3] fix: use generic billing limit copy for 402 error page 402 can be triggered by various billing limits, not only budget caps. Update copy to reflect this. --- src/routes/(console)/+error.svelte | 4 ++-- src/routes/(console)/project-[region]-[project]/+error.svelte | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/(console)/+error.svelte b/src/routes/(console)/+error.svelte index ec00cecb1a..b2751b53c6 100644 --- a/src/routes/(console)/+error.svelte +++ b/src/routes/(console)/+error.svelte @@ -24,10 +24,10 @@
- + - Your organization has reached its budget limit + Your organization has reached a billing limit Access to resources has been blocked. Update your billing settings to diff --git a/src/routes/(console)/project-[region]-[project]/+error.svelte b/src/routes/(console)/project-[region]-[project]/+error.svelte index ab7473aa10..3c724180c1 100644 --- a/src/routes/(console)/project-[region]-[project]/+error.svelte +++ b/src/routes/(console)/project-[region]-[project]/+error.svelte @@ -26,10 +26,10 @@
- + - Your organization has reached its budget limit + Your organization has reached a billing limit Access to this resource has been blocked. Update your billing settings to From 95f665591360cb57f6fb26544142826ece51061c Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Wed, 20 May 2026 11:06:11 +0530 Subject: [PATCH 3/3] fix: use backend error message on 402 billing limit page --- src/routes/(console)/+error.svelte | 5 +---- .../(console)/project-[region]-[project]/+error.svelte | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/routes/(console)/+error.svelte b/src/routes/(console)/+error.svelte index b2751b53c6..a4b8533bd1 100644 --- a/src/routes/(console)/+error.svelte +++ b/src/routes/(console)/+error.svelte @@ -29,10 +29,7 @@ Your organization has reached a billing limit - - Access to resources has been blocked. Update your billing settings to - restore access. - + {page.error.message}
diff --git a/src/routes/(console)/project-[region]-[project]/+error.svelte b/src/routes/(console)/project-[region]-[project]/+error.svelte index 3c724180c1..fd42e37f5b 100644 --- a/src/routes/(console)/project-[region]-[project]/+error.svelte +++ b/src/routes/(console)/project-[region]-[project]/+error.svelte @@ -31,10 +31,7 @@ Your organization has reached a billing limit - - Access to this resource has been blocked. Update your billing settings to - restore access. - + {page.error.message}