Port Login UI

This commit is contained in:
Paul
2021-06-18 20:21:54 +01:00
parent aa81ebb298
commit 68a35751b3
18 changed files with 749 additions and 3 deletions

View File

@@ -0,0 +1,18 @@
export function takeError(
error: any
): string {
const type = error?.response?.data?.type;
let id = type;
if (!type) {
if (error?.response?.status === 403) {
return "Unauthorized";
} else if (error && (!!error.isAxiosError && !error.response)) {
return "NetworkError";
}
console.error(error);
return "UnknownError";
}
return id;
}