def make_exception(response, content, error_info=None, use_json=True):
    if isinstance(content, six.binary_type):
        content = content.decode('utf-8')

    if isinstance(content, six.string_types):
        payload = None
        if use_json:
            try:
                payload = json.loads(content)
            except ValueError:
                # Expected JSON but received something else.
                pass
        if payload is None:
            payload = {'error': {'message': content}}
    else:
        payload = content

    message = payload.get('error', {}).get('message', '')
    errors = payload.get('error', {}).get('errors', ())

    if error_info is not None:
        message += ' (%s)' % (error_info,)

    try:
        klass = _HTTP_CODE_TO_EXCEPTION[response.status]
    except KeyError:
        error = GCloudError(message, errors)
        error.code = response.status
    else:
        error = klass(message, errors)
    return error
Changes the duration for which the program will wait for a response from
dataset/ETHPy150Open GoogleCloudPlatform/gcloud-python/gcloud/exceptions.py/make_exception--crossover with--dataset/ETHPy150Open rackspace/pyrax/pyrax/clouddns.py/CloudDNSManager._set_timeout