def __init__(self, function, message=None):
        """Construct a LoginRequired exception.

        :param function: The function that requires login-based authentication.
        :param message: A custom message to associate with the exception.
            Default: `function` requires a logged in session

        """
        if not message:
            message = '`{0}` requires a logged in session'.format(function)
        super(LoginRequired, self).__init__(message)
Construct a LoginRequired exception.

        :param function: The function that requires login-based authentication.
        :param message: A custom message to associate with the exception.
            Default: `function` requires a logged in session

        
rtv/packages/praw/errors.py