Lead conversion into account,contact and opportunity using process builder its throw an exception
"The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30128000000FH3r.
Flow error messages:An unhandled fault has occurred in this flow An unhandled fault has occurred while processing the flow.
Please contact your system administrator for more information. Contact your administrator for help."
public class AutoConvertLeads
{
@InvocableMethod
public static void LeadAssign(List<Id> LeadIds)
{
LeadStatus CLeadStatus= [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true Limit 1];
System.debug('---MasterLabel--'+CLeadStatus.MasterLabel);
List<Database.LeadConvert> MassLeadconvert = new List<Database.LeadConvert>();
for(id currentlead: LeadIds){
Database.LeadConvert Leadconvert = new Database.LeadConvert();
Leadconvert.setLeadId(currentlead);
Leadconvert.setConvertedStatus(CLeadStatus.MasterLabel);
Leadconvert.setDoNotCreateOpportunity(TRUE);
MassLeadconvert.add(Leadconvert);
}
if (!MassLeadconvert.isEmpty() && MassLeadconvert.size()>0) {
List<Database.LeadConvertResult> lcr = Database.convertLead(MassLeadconvert);
}
}
}