Is there any way to get at least some information inside of here?
...
catch(...)
{
std::cerr << \"Unhandled exception\" << std::endl;
}
Yes there is, but how useful it is is open to debate:
#include
#include
using namespace std;
int f() {
throw "message";
}
int main() {
try {
f();
}
catch ( ... ) {
try {
throw;
}
catch( const char * s ) {
cout << "caught " << s << endl;
}
}
}
And to actually to answer your question, IMHO you should always have a catch(...) at the top level of your code, that terminates (or otherwise handles) when presented with an unexpected exception in your application, in a manner fully documented by your application's manual.