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 {
1717export function PreviewUnreachable({ url, code, description, onReload }: Props) {
1818 const [showDetails, setShowDetails] = useState(false);
1919 const host = safeHost(url) ?? url;
20 const friendly = describePreviewError(code, description);
20 const friendly = describePreviewError(description);
2121 const errorLabel = description.length > 0 ? description : `ERR_${Math.abs(code) || "FAILED"}`;
2222
2323 return (
apps/web/src/components/preview/errorCodeMessages.ts+3-3
......@@ -2,11 +2,11 @@ import { PREVIEW_ERROR_CODE_MESSAGES } from "./previewConstants";
22
33/**
44 * 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.
66 */
7export function describePreviewError(code: number, description: string): string {
7export function describePreviewError(description: string): string {
88 const friendly = PREVIEW_ERROR_CODE_MESSAGES[description];
99 if (friendly) return friendly;
1010 if (description.length > 0) return description;
11 return `Network error (${code})`;
11 return "Network error";
1212}