aboutsummaryrefslogtreecommitdiff
path: root/src/p2p
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-03-19 21:48:36 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-03-19 21:48:36 +0000
commitfff238ec94ac6d45fc18c315d7bc590ddfaad63d (patch)
treed138554a5a13e650f45f3d8d4b8bd0c9c1748235 /src/p2p
parentMerge pull request #732 (diff)
downloadmonero-fff238ec94ac6d45fc18c315d7bc590ddfaad63d.tar.xz
Print stack trace upon exceptions
Useful for debugging users' logs
Diffstat (limited to 'src/p2p')
-rw-r--r--src/p2p/data_logger.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/p2p/data_logger.cpp b/src/p2p/data_logger.cpp
index ca0726c5f..d3ff0ca8e 100644
--- a/src/p2p/data_logger.cpp
+++ b/src/p2p/data_logger.cpp
@@ -33,6 +33,7 @@
#include <boost/filesystem.hpp>
#include <boost/thread.hpp>
#include <chrono>
+#include "common/exception.h"
#include "../../contrib/otshell_utils/utils.hpp"
namespace epee
@@ -43,7 +44,7 @@ namespace net_utils
boost::call_once(m_singleton,
[] {
_info_c("dbg/data","Creating singleton of data_logger");
- if (m_state != data_logger_state::state_before_init) { _erro_c("dbg/data","Internal error in singleton"); throw std::runtime_error("data_logger singleton"); }
+ if (m_state != data_logger_state::state_before_init) { _erro_c("dbg/data","Internal error in singleton"); throw tools::runtime_error("data_logger singleton"); }
m_state = data_logger_state::state_during_init;
m_obj.reset(new data_logger());
m_state = data_logger_state::state_ready_to_use;
@@ -52,7 +53,7 @@ namespace net_utils
if (m_state != data_logger_state::state_ready_to_use) {
_erro ("trying to use not working data_logger");
- throw std::runtime_error("data_logger ctor state");
+ throw tools::runtime_error("data_logger ctor state");
}
return * m_obj;
@@ -60,7 +61,7 @@ namespace net_utils
data_logger::data_logger() {
_note_c("dbg/data","Starting data logger (for graphs data)");
- if (m_state != data_logger_state::state_during_init) { _erro_c("dbg/data","Singleton ctor state"); throw std::runtime_error("data_logger ctor state"); }
+ if (m_state != data_logger_state::state_during_init) { _erro_c("dbg/data","Singleton ctor state"); throw tools::runtime_error("data_logger ctor state"); }
boost::lock_guard<boost::mutex> lock(mMutex); // lock
// prepare all the files for given data channels: