[Boost-bugs] [Boost C++ Libraries] #5384: `diagnostic_information_what` returns 0 when no `error_info` is added to exception

Subject: [Boost-bugs] [Boost C++ Libraries] #5384: `diagnostic_information_what` returns 0 when no `error_info` is added to exception
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-03-29 09:35:03


#5384: `diagnostic_information_what` returns 0 when no `error_info` is added to
exception
---------------------------------------------------+------------------------
 Reporter: Pavel Machyniak <machyniak@…> | Owner: emildotchevski
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: exception
  Version: Boost 1.46.0 | Severity: Problem
 Keywords: |
---------------------------------------------------+------------------------
 Scenario:
  - throwing derived exception from both `boost::exception` and
 `std::exception`
  - catching as `std::exception`
  - logging with `e.what()`, what is overridden and uses
 `boost::diagnostic_information_what`
  - when throwing such exception with `error_info` added, everything is
 fine
  - when throwing such exception without `error_info` added, no string is
 returned from `diagnostic_information_what`, at least I would expect the
 string like `"Dynamic exception type: struct TestException"`

 Observations:
 In `diagnostic_information_what` implementation is correct string
 generated by `exception_detail::diagnostic_information_impl` but is
 trashed and `exception_detail::get_diagnostic_information` returns 0 in
 described case.

 Workaround:
 We are using internal
 `boost::exception_detail::diagnostic_information_impl` instead of
 `boost::diagnostic_information_what`.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5384>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC