<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def featureclass_to_json(fc):
 """converts a feature class to JSON"""

    if arcpyFound == False:
        raise Exception("ArcPy is required to use this function")
    desc = arcpy.Describe(fc)
    if desc.dataType == "Table" or desc.dataType == "TableView":
        return recordset_to_json(table=fc)
    else:
        return arcpy.FeatureSet(fc).JSON