I have below Apex class (DAO class) which has a try-catch block. Same try-catch block has been used in 5 different methods. I tried sending setOpportunityId as account id or null id but still, it is not going to catch block.
Class:
public with sharing class OppUpdateDAO {
public static List<Opportunity> getOpportunityData(set<ID> setOpportunityId) {
try {
List<Opportunity> opportunityList = new List<Opportunity>();
opportunityList=[select id , name, stageName,RecordTypeId ,Market__cfrom Opportunity where id in:setOpportunityId ];
return opportunityList;
}
catch (Exception e) {
Error_Handling__c error = M2O_ErrorHandling.errorHandling (e);
insert error;
return null;
}
}
}
public static Opportunity[] getOpportunityData(set<ID> setOpportunityId) { return [select name, stageName, RecordTypeId, Market__c from Opportunity where id in :setOpportunityId ]; }