diff --git a/rai/node/logging.hpp b/rai/node/logging.hpp index ebf19ecb..24dcc274 100644 --- a/rai/node/logging.hpp +++ b/rai/node/logging.hpp @@ -6,6 +6,8 @@ #include #include +#define FATAL_LOG_PREFIX "FATAL ERROR: " + namespace rai { class logging diff --git a/rai/node/node.cpp b/rai/node/node.cpp index c7e363ff..805f64ce 100644 --- a/rai/node/node.cpp +++ b/rai/node/node.cpp @@ -51,8 +51,24 @@ on (true) { process_packets (); } + catch (boost::system::error_code & ec) + { + BOOST_LOG (this->node.log) << FATAL_LOG_PREFIX << ec.message (); + release_assert (false); + } + catch (std::error_code & ec) + { + BOOST_LOG (this->node.log) << FATAL_LOG_PREFIX << ec.message (); + release_assert (false); + } + catch (std::runtime_error & err) + { + BOOST_LOG (this->node.log) << FATAL_LOG_PREFIX << err.what (); + release_assert (false); + } catch (...) { + BOOST_LOG (this->node.log) << FATAL_LOG_PREFIX << "Unknown exception"; release_assert (false); } if (this->node.config.logging.network_packet_logging ())