From 330b8cb300b0047a481a536cc820096944f274a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mart=C3=ADn=20Ferrari?= Date: Sun, 27 Aug 2017 22:27:34 +0200 Subject: [PATCH] More specific error message for "unknown" exceptions. --- src/app/application.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/app/application.cpp b/src/app/application.cpp index c78ee99..e8ad62b 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -17,6 +17,11 @@ * You should have received a copy of the GNU General Public License along with * ConfClerk. If not, see . */ +#if defined(__GNUC__) || defined(__llvm__) || defined(__clang__) +#include +#endif +#include + #include "application.h" #include "errormessage.h" @@ -32,8 +37,17 @@ bool Application::notify(QObject* receiver, QEvent* event) } catch (OrmException& e) { error_message("UNCAUGHT OrmException: " + e.text()); return false; + } catch (std::exception& e) { + error_message("UNCAUGHT exception: " + QString(e.what())); + return false; } catch (...) { - error_message("UNCAUGHT EXCEPTION: unknown"); + error_message("UNCAUGHT exception: " + +#if defined(__GNUC__) || defined(__llvm__) || defined(__clang__) + QString(__cxxabiv1::__cxa_current_exception_type()->name()) +#else + "unknown" +#endif + ); return false; } } -- 2.39.5