Nested Try and Catch blocks [closed]

If you don’t want to execute the outer exception in that case you should not throw the exception from the inner catch block.

try
{
 //do something
   try
   {
      //do something              IF EXCEPTION HAPPENs don't Go to parent catch
   }
   catch(Exception ex)
   {  
     // logging and don't use "throw" here.
   }
}
catch(Exception ex)
{ 
  // outer logging
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)