I have this code in my program:
catch (boost::exception& ex) { // error handling }
How to print the details? Error message, stacktrace etc.
For something in common, like boost::exception , I think you're looking for the boost::diagnostic_information function to get a nice string representation.
boost::exception
boost::diagnostic_information
To get the stack for the exception, I would start by asking StackOverflow the trace stack of the C ++ screen stack for the exception .
You can use boost :: diagnost_information () to get the actual error messages and the origin of the exception. i.e.
catch (const boost::exception& ex) { // error handling std::cerr << boost::diagnostic_information(ex); }