diff --git a/src/contexts/UserAuthenticationContext.tsx b/src/contexts/UserAuthenticationContext.tsx index 43adc9e..93f6751 100644 --- a/src/contexts/UserAuthenticationContext.tsx +++ b/src/contexts/UserAuthenticationContext.tsx @@ -1,5 +1,5 @@ -import type { IuserInformations } from "@/utils/requests/Types"; import authenticateUser from "@/utils/requests/authenticateUser"; +import type { IuserInformations } from "@/utils/requests/types"; import getUserInformations from "@/utils/requests/userInformations"; import { LOG } from "@logger"; import AsyncStorage from "@react-native-async-storage/async-storage"; @@ -192,8 +192,8 @@ export const UserAuthenticationContextProvider = ({ children }: { children: Reac const storeAuthenticationData = async (authenticationData: IauthenticationData) => { try { await AsyncStorage.setItem("authenticationData", JSON.stringify(authenticationData)); - } catch (e) { - log.error("storeAuthenticationData |", e); + } catch (error) { + log.error("storeAuthenticationData |", JSON.stringify(error, null, 2)); // saving error } }; @@ -201,8 +201,8 @@ export const UserAuthenticationContextProvider = ({ children }: { children: Reac const storeUserInformations = async (userInformations: IuserInformations) => { try { await AsyncStorage.setItem("userInformations", JSON.stringify(userInformations)); - } catch (e) { - log.error("storeUserInformations |", e); + } catch (error) { + log.error("storeUserInformations |", JSON.stringify(error, null, 2)); // saving error } }; @@ -210,8 +210,8 @@ export const UserAuthenticationContextProvider = ({ children }: { children: Reac const clearStorages = async () => { try { await AsyncStorage.clear(); - } catch (e) { - log.error("clearStorages |", e); + } catch (error) { + log.error("clearStorages |", JSON.stringify(error, null, 2)); // saving error } }; @@ -242,7 +242,10 @@ export const UserAuthenticationContextProvider = ({ children }: { children: Reac // navigation.navigate("appBottomTabsNavigator"); } } catch (error) { - } finally { + log.error( + "UserAuthenticationContext | App Startup | error during retrieval of stored data |", + JSON.stringify(error, null, 2), + ); } })(); }, []);