import wikipedia
import random
import logging

# Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

def explore_tangent() -> str:
    """
    Explores an interesting tangent by fetching a random Wikipedia article.

    Returns:
        str: The title of the random Wikipedia article.

    Raises:
        Exception: If there is an error fetching the random article.
    """
    try:
        article_title = wikipedia.random()
        logging.info(f"Exploring tangent: {article_title}")
        return article_title
    except wikipedia.exceptions.WikipediaException as e:
        logging.error(f"Error fetching random Wikipedia article: {e}")
        raise
    except Exception as e:
        logging.error(f"An unexpected error occurred: {e}")
        raise

if __name__ == '__main__':
    try:
        tangent = explore_tangent()
        print(f"A potentially interesting tangent: {tangent}")
    except Exception as e:
        print(f"Failed to explore a tangent: {e}")