F
Franz
try
{
}
catch (ExceptionA A)
{
XXXXXXXXXXXXX
}
catch (ExceptionB B)
{
XXXXXXXXXXXXX
}
catch (Exception)
{
YYYYYYYYYYYYY
}
Actually the codes of hanlding both Exception A and B are same. I want to
put it in a single catch block. Although I know that I can group the code
into a function and call it in these two catch blocks, I don't want to have
duplicated code. Also I don't want to give a inheritance relationship for
both ExceptionA and ExceptionB. I
Is there anything like the following? I want to do the following because if
a large number of exception use the same hanlding code, then I can group
them into a small number of brackets.
try
{
}
catch (ExceptionA A)
catch (ExceptionB B)
{
XXXXXXXXXXXXX
}
catch (Exception)
{
YYYYYYYYYYYYY
}
Thanks.
{
}
catch (ExceptionA A)
{
XXXXXXXXXXXXX
}
catch (ExceptionB B)
{
XXXXXXXXXXXXX
}
catch (Exception)
{
YYYYYYYYYYYYY
}
Actually the codes of hanlding both Exception A and B are same. I want to
put it in a single catch block. Although I know that I can group the code
into a function and call it in these two catch blocks, I don't want to have
duplicated code. Also I don't want to give a inheritance relationship for
both ExceptionA and ExceptionB. I
Is there anything like the following? I want to do the following because if
a large number of exception use the same hanlding code, then I can group
them into a small number of brackets.
try
{
}
catch (ExceptionA A)
catch (ExceptionB B)
{
XXXXXXXXXXXXX
}
catch (Exception)
{
YYYYYYYYYYYYY
}
Thanks.