Boost C++ Libraries: Ticket #5384: `diagnostic_information_what` returns 0 when no `error_info` is added to exception https://svn.boost.org/trac10/ticket/5384 <p> Scenario: </p> <ul><li>throwing derived exception from both <code>boost::exception</code> and <code>std::exception</code> </li><li>catching as <code>std::exception</code> </li><li>logging with <code>e.what()</code>, what is overridden and uses <code>boost::diagnostic_information_what</code> </li><li>when throwing such exception with <code>error_info</code> added, everything is fine </li><li>when throwing such exception without <code>error_info</code> added, no string is returned from <code>diagnostic_information_what</code>, at least I would expect the string like <code>"Dynamic exception type: struct TestException"</code> </li></ul><p> Observations: In <code>diagnostic_information_what</code> implementation is correct string generated by <code>exception_detail::diagnostic_information_impl</code> but is trashed and <code>exception_detail::get_diagnostic_information</code> returns 0 in described case. </p> <p> Workaround: We are using internal <code>boost::exception_detail::diagnostic_information_impl</code> instead of <code>boost::diagnostic_information_what</code>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5384 Trac 1.4.3 Emil Dotchevski Tue, 05 Apr 2011 00:12:22 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5384#comment:1 https://svn.boost.org/trac10/ticket/5384#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> fixed, trunk revision 70988 </p> Ticket