Another exception handling question
I've written some code for a school assignment that looks redundant. Here is the abstracted version:
try
{
...
}
catch (ExceptionType1 e)
{
cout << e.what();
}
catch (ExceptionType2 e)
{
cout << e.what();
}
Since both exceptions do the exact same thing when they are caught, is there a way to catch both exceptions at once? All of the resources that I've looked at including our book catch them each individually.
try
{
...
}
catch (ExceptionType1 e)
{
cout << e.what();
}
catch (ExceptionType2 e)
{
cout << e.what();
}
Since both exceptions do the exact same thing when they are caught, is there a way to catch both exceptions at once? All of the resources that I've looked at including our book catch them each individually.
