import json


def dumpJson(path: str, data: dict):
    """
    Dump data to json path.

    Returns
    -------
    `tuple(path or exception, True or False)` :
        First item in tuple is a path if dumping succeeds, else it's an exceptions. Same thing goes for the second tuple
    """

    try:
        with open(path, "w+") as f:
            json.dump(data, f, indent=4)
        return path, True
    except Exception as e:
        return e, False