'Parse the JSON response body, or raise exceptions as appropriate.
:return:  JSON dictionary
:rtype:   ``dict``'

def parse_body(self):

    if ((len(self.body) == 0) and (not self.parse_zero_length_body)):
        return self.body
    json_error = False
    try:
        body = json.loads(self.body)
    except:
        body = self.body
        json_error = True
    valid_http_codes = [httplib.OK, httplib.CREATED, httplib.ACCEPTED, httplib.CONFLICT]
    if (self.status in valid_http_codes):
        if json_error:
            raise JsonParseError(body, self.status, None)
        elif ('error' in body):
            (code, message) = self._get_error(body)
            if (code == 'QUOTA_EXCEEDED'):
                raise QuotaExceededError(message, self.status, code)
            elif (code == 'RESOURCE_ALREADY_EXISTS'):
                raise ResourceExistsError(message, self.status, code)
            elif (code == 'alreadyExists'):
                raise ResourceExistsError(message, self.status, code)
            elif code.startswith('RESOURCE_IN_USE'):
                raise ResourceInUseError(message, self.status, code)
            else:
                raise GoogleBaseError(message, self.status, code)
        else:
            return body
    elif (self.status == httplib.NOT_FOUND):
        if ((not json_error) and ('error' in body)):
            (code, message) = self._get_error(body)
        else:
            message = body
            code = None
        raise ResourceNotFoundError(message, self.status, code)
    elif (self.status == httplib.BAD_REQUEST):
        if ((not json_error) and ('error' in body)):
            (code, message) = self._get_error(body)
        else:
            message = body
            code = None
        raise InvalidRequestError(message, self.status, code)
    else:
        if ((not json_error) and ('error' in body)):
            (code, message) = self._get_error(body)
        else:
            message = body
            code = None
        raise GoogleBaseError(message, self.status, code)
