authorgravatar for technocratix902@gmail.comKriday Dave <technocratix902@gmail.com> 2026-07-18 01:20:33+05:30
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-07-17 19:50:33+00:00
logb49a2e677c6fba6d705ad16dbd913f56df4035d6
tree099b741cbc582ce313b98260a50927f2aa44d20f
parented81c156daf3d8ce7d3599236df7a26c11ef145f
signature Signed by PGP key B5690EEEBB952194

Remove unused code parameter from describePreviewError (#3970)

Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: Julius Marminge <jmarminge@gmail.com>

2 files changed, 4 insertions(+), 4 deletions(-)

apps/web/src/components/preview/PreviewUnreachable.tsx+1-1
...@@ -17,7 +17,7 @@ interface Props {...@@ -17,7 +17,7 @@ interface Props {
17export function PreviewUnreachable({ url, code, description, onReload }: Props) {17export function PreviewUnreachable({ url, code, description, onReload }: Props) {
18 const [showDetails, setShowDetails] = useState(false);18 const [showDetails, setShowDetails] = useState(false);
19 const host = safeHost(url) ?? url;19 const host = safeHost(url) ?? url;
20 const friendly = describePreviewError(code, description);20 const friendly = describePreviewError(description);
21 const errorLabel = description.length > 0 ? description : `ERR_${Math.abs(code) || "FAILED"}`;21 const errorLabel = description.length > 0 ? description : `ERR_${Math.abs(code) || "FAILED"}`;
2222
23 return (23 return (
apps/web/src/components/preview/errorCodeMessages.ts+3-3
...@@ -2,11 +2,11 @@ import { PREVIEW_ERROR_CODE_MESSAGES } from "./previewConstants";...@@ -2,11 +2,11 @@ import { PREVIEW_ERROR_CODE_MESSAGES } from "./previewConstants";
22
3/**3/**
4 * Resolve a friendly description for a Chromium / network error. Falls back4 * Resolve a friendly description for a Chromium / network error. Falls back
5 * to the description string passed in when the code isn't in our table.5 * to the description string passed in when it isn't in our table.
6 */6 */
7export function describePreviewError(code: number, description: string): string {7export function describePreviewError(description: string): string {
8 const friendly = PREVIEW_ERROR_CODE_MESSAGES[description];8 const friendly = PREVIEW_ERROR_CODE_MESSAGES[description];
9 if (friendly) return friendly;9 if (friendly) return friendly;
10 if (description.length > 0) return description;10 if (description.length > 0) return description;
11 return `Network error (${code})`;11 return "Network error";
12}12}