You need to sign in to do that
Don't have an account?
Balayesu Chilakalapudi
How to cover try-catch block in my Test class
I had a try-catch block like this in my class,
Please help me to cover catch block.
try { String shref = ApexPages.currentPage().getURL(); System.debug('>>> HouseholdMemberController shref='+shref); } catch (Exception e) { System.debug('>>> ERROR ='+e); }
Please help me to cover catch block.
If you want to cover catch in any cost try to update your code like below
All Answers
Excpetion part will only cover when any exception will come. In Above Code look like no excpetion will come.
My Test class is It is not covering catch block of source code.
If you want to cover catch in any cost try to update your code like below