From 35e3aa34d8570b21b09f409d41a0ec42b5b0da2f Mon Sep 17 00:00:00 2001 From: Narvis Bot Date: Tue, 3 Mar 2026 01:24:12 -0800 Subject: [PATCH] fix: show specific error messages for waitlist registration (#673) Instead of a generic 'Registration failed' for all errors, now shows: - Already registered status (already handled, unchanged) - Rate limit exceeded (429) message - Service unavailable (503) message - Network error message (catch block) Added i18n keys: errorRateLimit, errorServiceUnavailable, errorNetwork Co-Authored-By: Claude Opus 4.6 --- src/locales/en.json | 3 +++ src/settings-main.ts | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/locales/en.json b/src/locales/en.json index 570acfa26..47906d88b 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -483,6 +483,9 @@ "success": "You're on the list! We'll notify you first.", "alreadyRegistered": "You're already on the waitlist.", "error": "Registration failed. Please try again.", + "errorRateLimit": "Too many attempts. Please try again in an hour.", + "errorServiceUnavailable": "Registration service is temporarily unavailable.", + "errorNetwork": "Network error. Check your connection and try again.", "invalidEmail": "Please enter a valid email address." }, "byokTitle": "Or bring your own keys", diff --git a/src/settings-main.ts b/src/settings-main.ts index b9af834dc..c70cf0255 100644 --- a/src/settings-main.ts +++ b/src/settings-main.ts @@ -300,12 +300,18 @@ function initOverviewListeners(area: HTMLElement): void { ? t('modals.settingsWindow.worldMonitor.register.alreadyRegistered') : t('modals.settingsWindow.worldMonitor.register.success'); regStatus.className = 'wm-reg-status ok'; + } else if (res.status === 429) { + regStatus.textContent = t('modals.settingsWindow.worldMonitor.register.errorRateLimit'); + regStatus.className = 'wm-reg-status error'; + } else if (res.status === 503) { + regStatus.textContent = t('modals.settingsWindow.worldMonitor.register.errorServiceUnavailable'); + regStatus.className = 'wm-reg-status error'; } else { regStatus.textContent = data.error || t('modals.settingsWindow.worldMonitor.register.error'); regStatus.className = 'wm-reg-status error'; } } catch { - regStatus.textContent = t('modals.settingsWindow.worldMonitor.register.error'); + regStatus.textContent = t('modals.settingsWindow.worldMonitor.register.errorNetwork'); regStatus.className = 'wm-reg-status error'; } finally { btn.disabled = false;