Log otherwise uncaught exceptions so we have an idea where it came from.

This commit is contained in:
Joseph Lenox 2018-05-17 22:36:43 -05:00 committed by Joseph Lenox
parent f14f34294f
commit bf57b74d9e
2 changed files with 8 additions and 0 deletions

View File

@ -209,4 +209,11 @@ void App::CallAfter(std::function<void()> cb_function) {
this->callback_register.unlock(); 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 }} // namespace Slic3r::GUI

View File

@ -36,6 +36,7 @@ public:
void CallAfter(std::function<void()> cb_function); void CallAfter(std::function<void()> cb_function);
void OnUnhandledException() override;
private: private:
std::shared_ptr<Settings> gui_config; // GUI-specific configuration options std::shared_ptr<Settings> gui_config; // GUI-specific configuration options