title: How to catch json.decoder.JSONDecodeError?
body: <p>My program, is not catching json <code>json.decoder.JSONDecodeError</code>, Although i have write the code to catch these errors (see the <code>try-except block</code>). what i am doing wrong?</p>
  <p>Error code:</p>
  <pre><code>raise JSONDecodeError(&quot;Expecting value&quot;, s, err.value) from None
  json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  </code></pre>
  <p>My code:</p>
  <pre><code>def check_code():
      url = get_url()
      headers = {'Accept': 'application/json'}
      response = requests.get(url, headers=headers).json()
      print(response)
      try:
          if (account := response.get('account')) and account.get('active'):
              status = &quot;active account &quot;
  
          else:
              status = &quot;not active account &quot;
      except (JSONDecodeError, json.JSONDecodeError):
          pass
  
      return status
  </code></pre>
  <p>I get the DecodeError randomly, sometimes after 2-3 tries, sometimes after 12-13</p>