If you only care about exceptions that you know about when you're writing the code then you can write a handler that can deal with all 'known' exceptions. The trick is to rethrow the exception that you caught with catch(...)
and then catch the various known exceptions...
So, something like:
try
{
...
}
catch(...)
{
if (!LogKnownException())
{
cerr << "unknown exception" << endl;
}
}
where LogKnownException()
looks something like this:
bool LogKnownException()
{
try
{
throw;
}
catch (const CMyException1 &e)
{
cerr << "caught a CMyException: " << e << endl;
return true;
}
catch (const Blah &e)
{
...
}
... etc
return false;
}