def METHOD_NAME(file_name, paylod):
    """Keeping track of errors in a file as the script runs"""
    data = []
    with open(file_name, "r+") as outfile:
        if os.path.getsize(file_name) != 0:
            data = json.loads(outfile.read())
            if data is None:
                data = []
        data.append(paylod)
        outfile.seek(0)
        json.dump(data, outfile, indent=2, default=str)
        outfile.truncate()