from typing import Callable
from typing import Optional


def inline_try(func: Callable) -> Optional[Exception]:
    """
    Try to execute an inline function without throwing an error. Useful when the Exception thrown is trivial.
    :param func: A function to call.
    :return: None if no exception is thrown or the Exception object thrown.
    """
    try:
        func()
        return None
    except Exception as e:
        return e