Subject: [Boost-bugs] [Boost C++ Libraries] #8312: Test definitions for throw_exception_test.cpp swapped?
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-03-20 01:21:34
#8312: Test definitions for throw_exception_test.cpp swapped?
----------------------------------------+-----------------------------------
Reporter: greg.julus@⦠| Owner: emildotchevski
Type: Bugs | Status: new
Milestone: To Be Determined | Component: exception
Version: Boost 1.52.0 | Severity: Problem
Keywords: |
----------------------------------------+-----------------------------------
I was attempting to learn how to extract the file, function, & line number
from a caught exception for logging and noticed the following in
boost_throw_exception_test found in throw_exception_test.cpp:
{{{
char const * const * file=boost::get_error_info<boost::throw_function>(x);
char const * const * function=boost::get_error_info<boost::throw_file>(x);
}}}
It appears the file is retrieving the function name and vice versa. I
didn't check to see if there were other instances of this occurrance.
I'm novice so I may be very wrong.
FYI: I was in this area because I couldn't figure out from the
documentation how to access the values placed by BOOST_THROW_EXCEPTION. I
finally figured out the following based upon what I found in your test
file:
{{{
if( char const * const * file=boost::get_error_info<boost::throw_file>(e)
) cout << "The File where it happened:" << *file << "\n";
if( char const * const *
function=boost::get_error_info<boost::throw_function>(e) ) cout << "The
Function where it happened:" << *function << "\n";
if( int const * line=boost::get_error_info<boost::throw_line>(e) ) cout <<
"The Line where it happened:" << *line << "\n";
}}}
-g
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8312> 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:12 UTC