mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Changed boost error handling (#74)
This commit is contained in:
@@ -77,15 +77,6 @@ void signal_handler(int signum)
|
||||
|
||||
namespace boost
|
||||
{
|
||||
/**
|
||||
* Global exception handler for boost exceptions.
|
||||
*/
|
||||
void throw_exception(std::exception const &e)
|
||||
{
|
||||
LOG_ERR << "Boost error: " << e.what() << "\n"
|
||||
<< boost::stacktrace::stacktrace();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
inline void assertion_failed_msg(char const *expr, char const *msg, char const *function, char const * /*file*/, long /*line*/)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef _HP_PCHHEADER_
|
||||
#define _HP_PCHHEADER_
|
||||
|
||||
// This will direct all boost exceptions to our error handler.
|
||||
#define BOOST_NO_EXCEPTIONS
|
||||
// Enable boost strack trace.
|
||||
#define BOOST_STACKTRACE_USE_BACKTRACE
|
||||
// Enable custom handlers for boost assertion failures.
|
||||
|
||||
@@ -229,7 +229,7 @@ void socket_session<T>::send(const T msg)
|
||||
try
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(send_mutex);
|
||||
|
||||
|
||||
// Always add to queue
|
||||
queue.push_back(std::move(msg));
|
||||
//using sync write until async_write is properly handled for multi-threaded writes.
|
||||
@@ -316,7 +316,7 @@ template <class T>
|
||||
void socket_session<T>::handle_exception(std::string_view event_name)
|
||||
{
|
||||
std::exception_ptr p = std::current_exception();
|
||||
LOG_ERR << "Socket Exception on " << event_name << ": " << (p ? p.__cxa_exception_type()->name() : "null") << std::endl;
|
||||
LOG_ERR << "Socket Exception on " << event_name << ": " << (p ? p.__cxa_exception_type()->name() : "null") << " :"<< boost::stacktrace::stacktrace()<< std::endl;
|
||||
|
||||
// Close the socket on any event error except close event.
|
||||
if (event_name != "close")
|
||||
|
||||
Reference in New Issue
Block a user