title: HTTPError Handling Python3 Firebase DB
body: <p>When I make the authorization call the Firebase with:</p>
  
  <pre><code>email = request.POST['email']
  password = request.POST['password']
  config = {
      "apiKey": "",
      "authDomain": "",
      "databaseURL": "",
      "storageBucket": ""
  }
  firebase = pyrebase.initialize_app(config)
  auth = firebase.auth()
  try:
      user = auth.create_user_with_email_and_password(email, password)
      user = auth.refresh(user['refreshToken'])
      request.session['user_uuid'] = user
      if user != "":
          print("You're logged in.")
          return redirect('')
      else:
          print("")
  
  except requests.exceptions.HTTPError as e:
      print(e)
  </code></pre>
  
  <p>I receive this response:</p>
  
  <pre><code>"[Errno 400 Client Error: Bad Request for url: 
  https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?
  key=%20AIzaSyCm0XR9oECpQOBTp_iouf3RJTD-Nq0fuXg] {
  "error": {
    "errors": [
  {
    "domain": "global",
    "reason": "invalid",
    "message": "WEAK_PASSWORD : Password should be at least 6 characters"
   }
  ],
  "code": 400,
  "message": "WEAK_PASSWORD : Password should be at least 6 characters"
  }
  }"
  </code></pre>
  
  <p>I'm trying to parse the message and code from the response, but I keep getting a subscriptable error. I'm using the following code to parse the response:</p>
  
  <pre><code>data = e[-1]
  data = (json.dumps(json.loads(data), sort_keys = True, indent = 4))
  data = json.loads(data)
  error = data['error']
  error_message = error['message']
  print(error_message)
  context_dict = {
      'message': error_message
  }
  </code></pre>