From c5653a14352ed68608bbef303d84efc1ab723049 Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Thu, 17 May 2018 22:36:43 -0500 Subject: [PATCH] Log otherwise uncaught exceptions so we have an idea where it came from. --- src/GUI/GUI.cpp | 7 +++++++ src/GUI/GUI.hpp | 1 + 2 files changed, 8 insertions(+) diff --git a/src/GUI/GUI.cpp b/src/GUI/GUI.cpp index b72e7b84a..d31344810 100644 --- a/src/GUI/GUI.cpp +++ b/src/GUI/GUI.cpp @@ -209,4 +209,11 @@ void App::CallAfter(std::function cb_function) { this->callback_register.unlock(); } +void App::OnUnhandledException() { + try { throw; } + catch (std::exception &e) { + Slic3r::Log::fatal_error(LogChannel, LOG_WSTRING("Exception Caught: " << e.what())); + } +} + }} // namespace Slic3r::GUI diff --git a/src/GUI/GUI.hpp b/src/GUI/GUI.hpp index 83389bbf2..054acd001 100644 --- a/src/GUI/GUI.hpp +++ b/src/GUI/GUI.hpp @@ -36,6 +36,7 @@ public: void CallAfter(std::function cb_function); + void OnUnhandledException() override; private: std::shared_ptr gui_config; // GUI-specific configuration options