提交 d18939cd 编写于 作者: A Anton Perkov

adding exception::top_message back since for now there is no other way to get...

adding exception::top_message back since for now there is no other way to get not decorated assert message
上级 b19391cc
......@@ -102,6 +102,11 @@ namespace fc
*/
std::string to_string( log_level ll = log_level::info )const;
/**
* Generates a user-friendly error report.
*/
std::string top_message( )const;
/**
* Throw this exception as its most derived type.
*
......
......@@ -185,6 +185,21 @@ namespace fc
return ss.str();
}
/**
* Generates a user-friendly error report.
*/
string exception::top_message( )const
{
for( auto itr = my->_elog.begin(); itr != my->_elog.end(); ++itr )
{
auto s = fc::format_string( itr->get_format(), itr->get_data() );
if (!s.empty()) {
return s;
}
}
return string();
}
void NO_RETURN exception_factory::rethrow( const exception& e )const
{
auto itr = _registered_exceptions.find( e.code() );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册