Print stack trace upon exceptions

Useful for debugging users' logs
This commit is contained in:
moneromooo-monero
2016-03-19 21:48:36 +00:00
parent d7fb03fc97
commit fff238ec94
43 changed files with 259 additions and 63 deletions
+1
View File
@@ -26,6 +26,7 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "common/exception.h"
#include "cryptonote_core/cryptonote_basic_impl.h"
#include "daemon/command_parser_executor.h"
+1
View File
@@ -26,6 +26,7 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "common/exception.h"
#include "cryptonote_config.h"
#include "version.h"
#include "daemon/command_server.h"
+3 -3
View File
@@ -110,7 +110,7 @@ bool t_daemon::run(bool interactive)
{
if (nullptr == mp_internals)
{
throw std::runtime_error{"Can't run stopped daemon"};
throw tools::runtime_error{"Can't run stopped daemon"};
}
tools::signal_handler::install(std::bind(&daemonize::t_daemon::stop_p2p, this));
@@ -155,7 +155,7 @@ void t_daemon::stop()
{
if (nullptr == mp_internals)
{
throw std::runtime_error{"Can't stop stopped daemon"};
throw tools::runtime_error{"Can't stop stopped daemon"};
}
mp_internals->p2p.stop();
mp_internals->rpc.stop();
@@ -166,7 +166,7 @@ void t_daemon::stop_p2p()
{
if (nullptr == mp_internals)
{
throw std::runtime_error{"Can't send stop signal to a stopped daemon"};
throw tools::runtime_error{"Can't send stop signal to a stopped daemon"};
}
mp_internals->p2p.get().send_stop_signal();
}
+1 -1
View File
@@ -60,7 +60,7 @@ public:
LOG_PRINT_L0("Initializing p2p server...");
if (!m_server.init(vm))
{
throw std::runtime_error("Failed to initialize p2p server.");
throw tools::runtime_error("Failed to initialize p2p server.");
}
LOG_PRINT_L0("P2p server initialized OK");
}
+1 -1
View File
@@ -50,7 +50,7 @@ public:
LOG_PRINT_L0("Initializing cryptonote protocol...");
if (!m_protocol.init(vm))
{
throw std::runtime_error("Failed to initialize cryptonote protocol.");
throw tools::runtime_error("Failed to initialize cryptonote protocol.");
}
LOG_PRINT_L0("Cryptonote protocol initialized OK");
}
+2 -2
View File
@@ -55,7 +55,7 @@ public:
LOG_PRINT_L0("Initializing core rpc server...");
if (!m_server.init(vm))
{
throw std::runtime_error("Failed to initialize core rpc server.");
throw tools::runtime_error("Failed to initialize core rpc server.");
}
LOG_PRINT_GREEN("Core rpc server initialized OK on port: " << m_server.get_binded_port(), LOG_LEVEL_0);
}
@@ -65,7 +65,7 @@ public:
LOG_PRINT_L0("Starting core rpc server...");
if (!m_server.run(2, false))
{
throw std::runtime_error("Failed to start core rpc server.");
throw tools::runtime_error("Failed to start core rpc server.");
}
LOG_PRINT_L0("Core rpc server started ok");
}
+2 -1
View File
@@ -28,6 +28,7 @@
//
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
#include "common/exception.h"
#include "string_tools.h"
#include "common/scoped_message_writer.h"
#include "daemon/rpc_command_executor.h"
@@ -88,7 +89,7 @@ t_rpc_command_executor::t_rpc_command_executor(
{
if (rpc_server == NULL)
{
throw std::runtime_error("If not calling commands via RPC, rpc_server pointer must be non-null");
throw tools::runtime_error("If not calling commands via RPC, rpc_server pointer must be non-null");
}
}