how to have multiple exceptions in one try c# code example
Example: two exceptions same catch c#
try
{
// Code
}
catch (Exception ex) when (ex is ArbitraryType1 || ex is ArbitraryType2)
{
throw;
}
try
{
// Code
}
catch (Exception ex) when (ex is ArbitraryType1 || ex is ArbitraryType2)
{
throw;
}