title: googleapiclient.errors.HttpError: HttpError 404
body: <p>I have imported google library</p>
  <pre><code>from googleapiclient.errors import HttpError, Error
  </code></pre>
  <p>and this is my code</p>
  <pre><code>response = service.users().get(userKey=email).execute()
  
  user_id=(response['id'])
  try:
      if user_id:
          return True
  # except googleapiclient.errors.HttpError as e:
  except googleapiclient.errors.HttpError as e:
      print(e)
  </code></pre>
  <p>but it is still not catching that exception.</p>
  <p>Here is the error</p>
  <pre><code>googleapiclient.errors.HttpError: &lt;HttpError 404 when requesting https://admin.googleapis.com/admin/directory/v1/users/cccc%404domain`enter code here`.com?alt=json returned &quot;Resource Not Found: userKey&quot;. Details: &quot;Resource Not Found: userKey&quot;&gt;
  </code></pre>
  <p>purpose of my code is to check if that email already exists.
  If email exists it prints the email address but if email dose not exist it gives this error message above</p>