Remove unused code parameter from describePreviewError (#3970)
Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
2 files changed
+4
-4
No files matched your search
@@ -17,7 +17,7 @@ interface Props {
|
||||
export function PreviewUnreachable({ url, code, description, onReload }: Props) {
|
||||
const [showDetails, setShowDetails] = useState(false);
|
||||
const host = safeHost(url) ?? url;
|
||||
const friendly = describePreviewError(code, description);
|
||||
const friendly = describePreviewError(description);
|
||||
const errorLabel = description.length > 0 ? description : `ERR_${Math.abs(code) || "FAILED"}`;
|
||||
|
||||
return (
|
||||
|
||||
@@ -2,11 +2,11 @@ import { PREVIEW_ERROR_CODE_MESSAGES } from "./previewConstants";
|
||||
|
||||
/**
|
||||
* Resolve a friendly description for a Chromium / network error. Falls back
|
||||
* to the description string passed in when the code isn't in our table.
|
||||
* to the description string passed in when it isn't in our table.
|
||||
*/
|
||||
export function describePreviewError(code: number, description: string): string {
|
||||
export function describePreviewError(description: string): string {
|
||||
const friendly = PREVIEW_ERROR_CODE_MESSAGES[description];
|
||||
if (friendly) return friendly;
|
||||
if (description.length > 0) return description;
|
||||
return `Network error (${code})`;
|
||||
return "Network error";
|
||||
}
|
||||
Reference in new issue
Block a user