title: Handle JSON Decode Error when nothing returned
body: <p>I am parsing json data. I don't have an issue with parsing and I am using <code>simplejson</code> module. But some api requests returns empty value. Here is my example: </p>
  
  <pre><code>{
  "all" : {
      "count" : 0,
      "questions" : [     ]
      }
  }
  </code></pre>
  
  <p>This is the segment of my code where I parse the json object: </p>
  
  <pre><code> qByUser = byUsrUrlObj.read()
   qUserData = json.loads(qByUser).decode('utf-8')
   questionSubjs = qUserData["all"]["questions"]
  </code></pre>
  
  <p>As I mentioned for some requests I get the following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "YahooQueryData.py", line 164, in &lt;module&gt;
      qUserData = json.loads(qByUser)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/simplejson/__init__.py", line 385, in loads
      return _default_decoder.decode(s)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/simplejson/decoder.py", line 402, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/simplejson/decoder.py", line 420, in raw_decode
      raise JSONDecodeError("No JSON object could be decoded", s, idx)
  simplejson.decoder.JSONDecodeError: No JSON object could be decoded: line 1 column 0 (char 0)
  </code></pre>
  
  <p>What would be the best way to handle this error?</p>