def selectSupportedDiodes(diodeType):
    """ Returns footprint name of the supported diode, returns an error if not supported 
    
        Returned object will have this form:
            {
                "lib_dir":"",
                "footprint_ref": "",
            }
    """

    def selectTHTDiode():
        """ select parts for a through hole diode """
        print ("Using through-hole diode...")

        partName = {
            "lib_dir" : "Diode_THT",
            "footprint_ref": "D_DO-35_SOD27_P7.62mm_Horizontal"
        }
        return partName

    def selectSMDDiode():
       """ select parts for a surface mount diode """
       print ("Using surface mount diode...")

       partName = {
           "lib_dir" : "Diode_SMD",
           "footprint_ref": "D_SOD-123"
       }
       return partName

    def unsupportedDiode():
        """ For invalid options """
        print("Unsupported diode detected. Reverting to through-hole diodes")
        return selectTHTDiode()

    # Dictionary mapping
    diodeDict = {
        "smd" : selectSMDDiode,
        "tht" : selectTHTDiode
    }

    return diodeDict.get(diodeType, unsupportedDiode)()