Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beasy-mobile
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
G
beasy-mobile
Commits
ab833533
Commit
ab833533
authored
Sep 09, 2024
by
G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better logging of error cases
parent
6d1b4a31
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
UserAuthenticationContext.tsx
src/contexts/UserAuthenticationContext.tsx
+11
-8
No files found.
src/contexts/UserAuthenticationContext.tsx
View file @
ab833533
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
(
e
rror
)
{
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
(
e
rror
)
{
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
(
e
rror
)
{
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
),
);
}
})();
},
[]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment