exception.hpp: Add assert_trip debug logging for exceptions
This commit is contained in:
parent
e2e0f38dc6
commit
46d85a3462
1 changed files with 5 additions and 2 deletions
|
|
@ -6,9 +6,10 @@
|
||||||
#include <fc/log/logger.hpp>
|
#include <fc/log/logger.hpp>
|
||||||
#include <fc/optional.hpp>
|
#include <fc/optional.hpp>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
#include <functional>
|
||||||
|
#include <iostream>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
namespace detail { class exception_impl; }
|
namespace detail { class exception_impl; }
|
||||||
|
|
@ -291,7 +292,6 @@ namespace fc
|
||||||
FC_DECLARE_EXCEPTION( underflow_exception, underflow_code, "Integer Underflow" );
|
FC_DECLARE_EXCEPTION( underflow_exception, underflow_code, "Integer Underflow" );
|
||||||
|
|
||||||
std::string except_str();
|
std::string except_str();
|
||||||
|
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
|
|
@ -313,7 +313,10 @@ namespace fc
|
||||||
FC_EXPAND_MACRO( \
|
FC_EXPAND_MACRO( \
|
||||||
FC_MULTILINE_MACRO_BEGIN \
|
FC_MULTILINE_MACRO_BEGIN \
|
||||||
if( UNLIKELY(!(TEST)) ) \
|
if( UNLIKELY(!(TEST)) ) \
|
||||||
|
{ \
|
||||||
|
std::cout << "assert_trip: " << __FILE__ << ':' << __LINE__ << ": " << #TEST << "\n"; \
|
||||||
FC_THROW_EXCEPTION( fc::assert_exception, #TEST ": " __VA_ARGS__ ); \
|
FC_THROW_EXCEPTION( fc::assert_exception, #TEST ": " __VA_ARGS__ ); \
|
||||||
|
} \
|
||||||
FC_MULTILINE_MACRO_END \
|
FC_MULTILINE_MACRO_END \
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue