code: def _log_and_raise_exception(msg, data, cls=FoursquareException):
    
    data = u'{0}'.format(data)
    # We put data as a argument for log.error() so error tracking systems such
    # as Sentry will properly group errors together by msg only
    log.error(u'{0}: %s'.format(msg), data)
    raise cls(u'{0}: {1}'.format(msg, data))
docs: Calls log.error() then raises an exception of class cls