import json


def load_json(file_path):
    """
    Loads json from a file

    :param file_path: the path to the file
    :return: dictionary
    """
    try:
        with open(file_path, "r+") as file:
            return json.loads(file.read())
    except (OSError, IOError):
        with open(file_path, "r+") as file:
            file.truncate(0)
            file.seek(0)
            json.dump("{}", file, indent=4)
            return {}