I'm pretty good with exception handling in C/C++ - I know all about creating custom classes from std::exception, when to throw, when to fall back on simpler things like UNIX errno, etc. I do have one thing I'm always a little foggy about though when it comes to accessing COTS code.
If I call a function from a COTS library like so:
void DoSomething()
{
try
{
CallCotsFunction();
}
catch (CotsException& ce)
{
//Cots error caught
}
catch (...)
{
//Unknown error caught.
}
}
If CallCotsFunction()
has poor exception handling or no exception handling and performs a divide-by-zero or something, will it get propagated up to my exception handlers?
If CallCotsFunction()
causes a sig-11 or something of that sort will it get caught, or are all bets off with something that severe?