From 8a23c5527e660b4219cd9ad2dc0631f0299aafec Mon Sep 17 00:00:00 2001 From: oyi77 Date: Sun, 17 May 2026 05:58:41 +0700 Subject: [PATCH] feat(ui): replace cryptic error badges with human-readable labels Replace AUTH/429/5XX/NET/RUNTIME with Auth/Rate limited/Server error/Network/Runtime in provider error badges. --- src/app/(dashboard)/dashboard/providers/page.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app/(dashboard)/dashboard/providers/page.tsx b/src/app/(dashboard)/dashboard/providers/page.tsx index ab3a1c583b..4c752a757c 100644 --- a/src/app/(dashboard)/dashboard/providers/page.tsx +++ b/src/app/(dashboard)/dashboard/providers/page.tsx @@ -65,18 +65,18 @@ function getConnectionErrorTag(connection) { if (!connection) return null; const explicitType = connection.lastErrorType; - if (explicitType === "runtime_error") return "RUNTIME"; + if (explicitType === "runtime_error") return "Runtime"; if ( explicitType === "upstream_auth_error" || explicitType === "auth_missing" || explicitType === "token_refresh_failed" || explicitType === "token_expired" ) { - return "AUTH"; + return "Auth"; } - if (explicitType === "upstream_rate_limited") return "429"; - if (explicitType === "upstream_unavailable") return "5XX"; - if (explicitType === "network_error") return "NET"; + if (explicitType === "upstream_rate_limited") return "Rate limited"; + if (explicitType === "upstream_unavailable") return "Server error"; + if (explicitType === "network_error") return "Network"; const numericCode = Number(connection.errorCode); if (Number.isFinite(numericCode) && numericCode >= 400) { @@ -84,19 +84,19 @@ function getConnectionErrorTag(connection) { } const fromMessage = getErrorCode(connection.lastError); - if (fromMessage === "401" || fromMessage === "403") return "AUTH"; + if (fromMessage === "401" || fromMessage === "403") return "Auth"; if (fromMessage && fromMessage !== "ERR") return fromMessage; const msg = (connection.lastError || "").toLowerCase(); if (msg.includes("runtime") || msg.includes("not runnable") || msg.includes("not installed")) - return "RUNTIME"; + return "Runtime"; if ( msg.includes("invalid api key") || msg.includes("token invalid") || msg.includes("revoked") || msg.includes("unauthorized") ) - return "AUTH"; + return "Auth"; return "ERR"; }