I am using one try-catch block inside which there are multiple SOQL queries WITH SECURITY_ENFORCED. Do I need try catch block separately for each SOQL or the query exception would be handled in that one try-catch block which I am using.
Sample Code:
Apex
public static void myMethod(some parameter){
try{
//do I need separate try-catch block to catch the Query exception or it will be caught by the catch I am using??
List<Account> acc = [SELECT id, Name FROM Account WITH SECURITY_ENFORCED];
List<Contact> con = [SELECT id, LastName FROM Contact WITH SECURITY_ENFORCED];
//somelogic here
}catch(Exception e){
System.debug('Error--'+e.getMessage());
}
}