From 2978959c9048277c5aa09ce9cc3c884c23f4cc38 Mon Sep 17 00:00:00 2001 From: harbassan Date: Mon, 30 Sep 2024 16:48:45 +1300 Subject: [PATCH] chore: add unexpected error handling --- frontend/src/features/login/LoginPage/LoginPage.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/features/login/LoginPage/LoginPage.jsx b/frontend/src/features/login/LoginPage/LoginPage.jsx index 5ff87709..eb73a4f5 100644 --- a/frontend/src/features/login/LoginPage/LoginPage.jsx +++ b/frontend/src/features/login/LoginPage/LoginPage.jsx @@ -45,9 +45,12 @@ export default function LoginPage() { handleSignIn(user) .then(() => history.push(redirectPath)) .catch((e) => { - if (e.response.status === 403) { + if (e.response?.status === 403) { toast.error("Please sign in with your UoA account"); signOut(); + } else { + console.log(e); + toast.error("An unexpected error occurred while signing in"); } }); }, [user]);