def METHOD_NAME(obj):
    """Helper function to convert ErrorReport object to a dictionary.
    :param obj: Object to convert to a dictionary which can be saved as json.
    :type obj: object
    :return: The converted dictionary which can be saved as json.
    :rtype: dict
    """
    if isinstance(obj, ErrorReport):
        rdict = obj.__dict__
        return rdict
    return serialize_json_safe(obj)