Dear boost experts.
We are using boost::exception in a project of ours, and are trying to extract some information from an exception
to display to the user.
For example, diagnostic_information(e) returns this:
d:\projects\<project>\ClassName.cpp(376): Throw in function void __thiscall ClassName::CInetExceptionHandler<struct ClassName::BadLoginException>(class CInternetException *) const
Dynamic exception type: class boost::exception_detail::clone_impl<struct ClassName::BadLoginException>
std::exception::what: Unknown exception
[struct tag_implementation_ClassName_SpecificInfo_errstr *] = Error: 12014 Context: 0 Message: The password was not allowed
[struct tag_interface_CDataInterface_errstr *] = ClassName reports: Bad FTP login
What I want is to extract "Error: 12014 Context: 0 Message: The password was not allowed" or "ClassName reports: Bad FTP login"
from that exception.
However, these exceptions may be generated in DLLs that the main program know nothing about.
To simplify, here is what I do and want ot be happening:
1. Main program calls method in DLL
2. Main program knows this method can throw expections of type boost::exception
3. Main program catches such exception
4. Main program obtains string that is user-friendly from this exception