'Raises a BitlyError if bitly returns an error message.
Args:
data: A python dict created from the bitly json response
Raises:
BitlyError wrapping the bitly error message if one exists.'

def _CheckForError(self, data):

    if (('ERROR' in data) or (data['statusCode'] == 'ERROR')):
        raise BitlyError, data['errorMessage']
    for key in data['results']:
        if ((type(data['results']) is dict) and (type(data['results'][key]) is dict)):
            if (('statusCode' in data['results'][key]) and (data['results'][key]['statusCode'] == 'ERROR')):
                raise BitlyError, data['results'][key]['errorMessage']
