<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_config_json(config_file, data):
 """Serializes an object to disk. Args: config_file (str):
 The path on disk to save the file. data (object):
 The object to serialize. """

    outfile = None
    try:
        with open(config_file, 'w') as outfile:
            json.dump(data, outfile)
    except:
        line, filename, synerror = trace()
        raise ArcRestHelperError({
                    "function": "init_config_json",
                    "line": line,
                    "filename":  filename,
                    "synerror": synerror,
                                    }
                                    )
    finally:
        outfile = None

        del outfile

        gc.collect()