I'm trying to handle for errors when users are signing up or logging in to my app. The first error I'm trying to handle for is when a user tries to create an account with an email that already exists in the database. I get the following `HTTPError`:

```
 requests.exceptions.HTTPError: [Errno 400 Client Error: Bad Request for url: https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=] {
   "error": {
     "code": 400,
     "message": "EMAIL_EXISTS",
     "errors": [
       {
         "message": "EMAIL_EXISTS",
         "domain": "global",
         "reason": "invalid"
       }
     ]
   }
 }

```

I want to access the `"message": "EMAIL_EXISTS"` value in the below but I'm not sure how to do it. I've added the below code but that produces the following error:

```
     error_message = error["error"]["message"]
 TypeError: 'HTTPError' object is not subscriptable

```

```
import requests
import pyrebase

class CreateAccount():

    def create_account(self):

        try:
            auth.create_user_with_email_and_password(self.email, self.password)

        except requests.exceptions.HTTPError as error:
            print(error)
            error_message = error["error"]["message"]
            print(error_message)

```