Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r48604 - trunk/boost/exception
From: emil_at_[hidden]
Date: 2008-09-04 23:15:18


Author: emildotchevski
Date: 2008-09-04 23:15:18 EDT (Thu, 04 Sep 2008)
New Revision: 48604
URL: http://svn.boost.org/trac/boost/changeset/48604

Log:
improved output from diagnostic_information()
Text files modified:
   trunk/boost/exception/diagnostic_information.hpp | 26 ++++++++++++++------------
   1 files changed, 14 insertions(+), 12 deletions(-)

Modified: trunk/boost/exception/diagnostic_information.hpp
==============================================================================
--- trunk/boost/exception/diagnostic_information.hpp (original)
+++ trunk/boost/exception/diagnostic_information.hpp 2008-09-04 23:15:18 EDT (Thu, 04 Sep 2008)
@@ -38,23 +38,25 @@
     diagnostic_information( exception const & x )
         {
         std::ostringstream tmp;
- tmp <<
- "boost::exception diagnostic information:"
+ if( boost::shared_ptr<char const * const> f=get_error_info<throw_file>(x) )
+ {
+ tmp << *f;
+ if( boost::shared_ptr<int const> l=get_error_info<throw_line>(x) )
+ tmp << '(' << *l << "): ";
+ }
+ tmp << "Throw in function ";
+ if( boost::shared_ptr<char const * const> fn=get_error_info<throw_function>(x) )
+ tmp << *fn;
+ else
+ tmp << "(unknown)";
 #ifndef BOOST_NO_RTTI
- "\nDynamic exception type: " << BOOST_EXCEPTION_DYNAMIC_TYPEID(x).name();
+ tmp << "\nDynamic exception type: " << BOOST_EXCEPTION_DYNAMIC_TYPEID(x).name();
         if( std::exception const * e=dynamic_cast<std::exception const *>(&x) )
- tmp << "\nstd::exception::what: " << e->what()
+ tmp << "\nstd::exception::what: " << e->what();
 #endif
- ;
- if( boost::shared_ptr<char const * const> f=get_error_info<throw_function>(x) )
- tmp << "\nThrow function: " << *f;
- if( boost::shared_ptr<char const * const> f=get_error_info<throw_file>(x) )
- tmp << "\nThrow file name: " << *f;
- if( boost::shared_ptr<int const> l=get_error_info<throw_line>(x) )
- tmp << "\nThrow file line: " << *l;
         if( char const * s=exception_detail::get_diagnostic_information(x) )
             if( *s )
- tmp << "\n" << s;
+ tmp << '\n' << s;
         return tmp.str();
         }
     }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk