Application Security Testing: An Integral Part of DevOps

We can now have in C#. The catch block will execute only if the condition evaluates to true.

Please see below for an example.

catch (Exception ex)
{
  if (ex.Message.Contains("TLS"))
  {
      //capture TLS exception.
  }
  else
  {
     //do what you want or just throw
     throw
  }
}

 

Visit the DevX Tip Bank

 



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here