mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 19:15:54 +00:00
Put back BEAST_CATCH_UNHANDLED_EXCEPTIONS macro, but disabled by default
This commit is contained in:
@@ -74,6 +74,16 @@
|
|||||||
//#define BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES 1
|
//#define BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** Config: BEAST_CATCH_UNHANDLED_EXCEPTIONS
|
||||||
|
This will wrap thread entry points with an exception catching block.
|
||||||
|
A customizable hook is provided to get called when unhandled exceptions
|
||||||
|
are thrown.
|
||||||
|
@see ProtectedCall
|
||||||
|
*/
|
||||||
|
#ifndef BEAST_CATCH_UNHANDLED_EXCEPTIONS
|
||||||
|
//#define BEAST_CATCH_UNHANDLED_EXCEPTIONS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Libraries
|
// Libraries
|
||||||
|
|||||||
@@ -314,6 +314,7 @@ void ProtectedCall::call (Call& c)
|
|||||||
if (handler == nullptr)
|
if (handler == nullptr)
|
||||||
handler = &defaultHandler;
|
handler = &defaultHandler;
|
||||||
|
|
||||||
|
#if BEAST_CATCH_UNHANDLED_EXCEPTIONS
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
c ();
|
c ();
|
||||||
@@ -324,6 +325,11 @@ void ProtectedCall::call (Call& c)
|
|||||||
|
|
||||||
handler->onException (e);
|
handler->onException (e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
c ();
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef BEAST_CATCH_UNHANDLED_EXCEPTIONS
|
#ifndef BEAST_CATCH_UNHANDLED_EXCEPTIONS
|
||||||
#define BEAST_CATCH_UNHANDLED_EXCEPTIONS 1
|
#define BEAST_CATCH_UNHANDLED_EXCEPTIONS 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BEAST_DEBUG && ! defined (BEAST_CHECK_MEMORY_LEAKS)
|
#if BEAST_DEBUG && ! defined (BEAST_CHECK_MEMORY_LEAKS)
|
||||||
|
|||||||
Reference in New Issue
Block a user