def server_error(log_func, log_msg, status_exc):
    """
    Helper function for logging and returning web.HTTPError.

    :param callable log_func: logging function.
    :param str log_msg: log message.
    :param web.HTTPError status_exc: exception class
    :raises: status_exc instance
    :returns: does not return.
    """
    exc = status_exc()
    log_func('{0}: {1}'.format(exc, log_msg))
    raise exc
