How would I search for values in a dictionary?
<p>I am making an opensource twitch.tv API wrapper for python, so far I have:</p>

<pre><code>import urllib2
import json
import time
waittime = 1
baseurl = 'https://api.twitch.tv/kraken/'

class twitchchannelinfo():
    def __init__ (self,channel):
        self.channel = channel
        time.sleep(waittime)
        self.dict1 = json.loads(urllib2.urlopen(baseurl + 'channels/' + channel).read())

    def getstatus(self):
        return self.dict1 ['status']
    def getdisplay_name(self):
        return self.dict1 ['display_name']
    def getmature(self):
        return self.dict1 ['mature']
    def getchanurl(self):
        return self.dict1 ['url']
    def getcreated_at(self):
        return self.dict1 ['created_at']
    def getteams(self):
        return self.dict1 ['teams']
    def getgame(self):
        return self.dict1 ['game']
    def getupdated_at(self):
        return self.dict1 ['updated_at']
</code></pre>

<p>and I would like to add error checking to this API. The server will return a json response like this for an error:</p>

<pre><code>{
    "error": "Unprocessable Entity",
    "status": 422,
    "message": "Channel 'deeman' is not available on Twitch"
}
</code></pre>

<p>which I then convert to a dictionary using <code>json.loads</code>. How would I check this dictionary for the value "error" or is there a better way of doing this?</p>
