mirror of
https://github.com/boostorg/exception.git
synced 2025-07-16 14:02:12 +02:00
minor diagnostic_information fix.
[SVN r48543]
This commit is contained in:
@ -30,28 +30,6 @@ boost
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
|
||||||
std::string
|
|
||||||
std_exception_diagnostic_information( std::exception const * x, T const & )
|
|
||||||
{
|
|
||||||
if( char const * s=x->what() )
|
|
||||||
if( *s )
|
|
||||||
return std::string("\nstd::exception::what(): ")+s;
|
|
||||||
return std::string();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
std::string
|
|
||||||
std_exception_diagnostic_information( void const *, T const & e )
|
|
||||||
{
|
|
||||||
#ifndef BOOST_NO_RTTI
|
|
||||||
if( std::exception const * x=dynamic_cast<std::exception const *>(&e) )
|
|
||||||
return std_exception_diagnostic_information(x,e);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
return std::string();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
@ -61,8 +39,10 @@ boost
|
|||||||
std::ostringstream tmp;
|
std::ostringstream tmp;
|
||||||
tmp <<
|
tmp <<
|
||||||
"boost::exception diagnostic information:"
|
"boost::exception diagnostic information:"
|
||||||
#if !defined(BOOST_NO_RTTI) && !defined(BOOST_NO_TYPEID)
|
#ifndef BOOST_NO_RTTI
|
||||||
"\nDynamic exception type: " << BOOST_EXCEPTION_DYNAMIC_TYPEID(x).name()
|
"\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()
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
if( boost::shared_ptr<char const * const> f=get_error_info<throw_function>(x) )
|
if( boost::shared_ptr<char const * const> f=get_error_info<throw_function>(x) )
|
||||||
@ -71,7 +51,7 @@ boost
|
|||||||
tmp << "\nThrow file name: " << *f;
|
tmp << "\nThrow file name: " << *f;
|
||||||
if( boost::shared_ptr<int const> l=get_error_info<throw_line>(x) )
|
if( boost::shared_ptr<int const> l=get_error_info<throw_line>(x) )
|
||||||
tmp << "\nThrow file line: " << *l;
|
tmp << "\nThrow file line: " << *l;
|
||||||
if( char const * s=exception_detail::get_diagnostic_information(x) )
|
if( char const * s=exception_detail::get_diagnostic_information(x) )
|
||||||
if( *s )
|
if( *s )
|
||||||
tmp << "\n" << s;
|
tmp << "\n" << s;
|
||||||
return tmp.str();
|
return tmp.str();
|
||||||
|
@ -160,13 +160,13 @@ boost
|
|||||||
template <class>
|
template <class>
|
||||||
struct get_info;
|
struct get_info;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct get_info<throw_function>;
|
struct get_info<throw_function>;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct get_info<throw_file>;
|
struct get_info<throw_file>;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct get_info<throw_line>;
|
struct get_info<throw_line>;
|
||||||
|
|
||||||
char const * get_diagnostic_information( exception const & );
|
char const * get_diagnostic_information( exception const & );
|
||||||
@ -313,10 +313,10 @@ boost
|
|||||||
virtual clone_base const * clone() const = 0;
|
virtual clone_base const * clone() const = 0;
|
||||||
virtual void rethrow() const = 0;
|
virtual void rethrow() const = 0;
|
||||||
|
|
||||||
virtual
|
virtual
|
||||||
~clone_base() throw()
|
~clone_base() throw()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline
|
inline
|
||||||
|
@ -29,9 +29,9 @@ boost
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
~error_info() throw()
|
~error_info() throw()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
value_type const &
|
value_type const &
|
||||||
value() const
|
value() const
|
||||||
|
Reference in New Issue
Block a user