Opened 12 years ago

Closed 12 years ago

#5384 closed Bugs (fixed)

`diagnostic_information_what` returns 0 when no `error_info` is added to exception

Reported by: Pavel Machyniak <machyniak@…> Owned by: Emil Dotchevski
Milestone: To Be Determined Component: exception
Version: Boost 1.46.0 Severity: Problem
Keywords: Cc:

Description

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.

Change History (1)

comment:1 by Emil Dotchevski, 12 years ago

Resolution: fixed
Status: newclosed

fixed, trunk revision 70988

Note: See TracTickets for help on using tickets.