![](https://cdn.discordapp.com/embed/avatars/2.png)
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?
let session = await appwrite.account.createEmailPasswordSession(username, password);
console.log("session", session)
![](https://cdn.discordapp.com/avatars/760015106947022880/9070ec666477447f5056eab9009a5df0.webp)
session.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
![](https://cdn.discordapp.com/avatars/760015106947022880/9070ec666477447f5056eab9009a5df0.webp)
![](https://cdn.discordapp.com/embed/avatars/2.png)
let promise = appwrite.account.createEmailPasswordSession(username, password);
promise.then(function (response) {
console.log("response", response); // Success
}, function (error) {
console.log("error", error); // Failure
});
The error codes etc isn't printed, I'm looking to get the response
![](https://cdn.discordapp.com/embed/avatars/2.png)
![](https://cdn.discordapp.com/avatars/760015106947022880/9070ec666477447f5056eab9009a5df0.webp)
it means you are already logged in, you have to be log out to login again
![](https://cdn.discordapp.com/embed/avatars/2.png)
I know, but I want to handle the error
![](https://cdn.discordapp.com/embed/avatars/2.png)
I want to get the response code ”type”
![](https://cdn.discordapp.com/embed/avatars/2.png)
Im only getting the message
Recommended threads
- I encountered an error at http://localho...
Hi, good morning and good evening. I have a problem again. I encountered an error while running http://localhost:3000/. I followed <@462046107556511744> steps t...
- Realtime is unable to connect for some r...
title basically. Here is the error: Ive noticed this happen when the tab is revisted after hibernated and a reload has not taken enough. To fix this you have ...
- End 2 End tests keep hitting rate limiti...
We have a CI/CD pipeline that runs our E2E test every time we commit a change to our PRs. We're consistently running into rate limiting issues. What are some so...
![](/images/bgs/pre-footer.png)