IsakOriginal post
Rank 2: Process
When I auth the user and a session is already initialized, I get this response in the console
{
"message": "Creation of a session is prohibited when a session is active.",
"code": 401,
"type": "user_session_already_exists",
"version": "1.5.7"
}
But when I console.log the response, it doesn't log. How am I supposed to handle the issue if I cannot get the error why the session can't start?
TypeScript
let session = await appwrite.account.createEmailPasswordSession(username, password);console.log("session", session)Summary
Developers are unable to handle the error on the auth session start. The user is trying to log out to log in again but the error codes are not returning, and they wish to get the response instead. The user is not able to see the 'type' error code needed for handling errors.
**Solution:**
The developer should log the error in the `catch` block of the promise to see the exact 'type' error code. This way they can handle the issue and take the necessary steps.