refactor utils
This commit is contained in:
1 parent
7906f2f615
commit
7c14d81a24
1 file changed
+1
-3
@@ -49,10 +49,8 @@ export const getNetworkErrorSubtype = (message?: string | null): NetworkErrorSub
|
||||
|
||||
export const formatStatusCode = (
|
||||
code: number | null | undefined,
|
||||
t: TranslateFn,
|
||||
fallback: string = "N/A"
|
||||
t: TranslateFn
|
||||
): string => {
|
||||
if (code == null) return fallback;
|
||||
if (isNetworkError(code)) return t("common.statusCode.down");
|
||||
return String(code);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user