/*
* Copyright (C) 2010 Ixonos Plc.
- * Copyright (C) 2011-2012 Philipp Spitzer, gregor herrmann, Stefan Stahl
+ * Copyright (C) 2011-2024 Philipp Spitzer, gregor herrmann, Stefan Stahl
*
* This file is part of ConfClerk.
*
* You should have received a copy of the GNU General Public License along with
* ConfClerk. If not, see <http://www.gnu.org/licenses/>.
*/
+#if defined(__GNUC__) || defined(__llvm__) || defined(__clang__)
+#include <cxxabi.h>
+#endif
+#include <exception>
+
#include "application.h"
#include "errormessage.h"
-#include <ormrecord.h>
+#include "ormrecord.h"
// if the application uses exceptions,
// there is always a possibility that some will leak uncached from event handler
} 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");
+#if defined(__GNUC__) || defined(__llvm__) || defined(__clang__)
+ int status = 0;
+ char *buff = __cxxabiv1::__cxa_demangle(
+ __cxxabiv1::__cxa_current_exception_type()->name(),
+ NULL, NULL, &status);
+ QString exception_name = QString(buff);
+ std::free(buff);
+#else
+ QString exception_name = QString("unknown");
+#endif
+ error_message("UNCAUGHT exception: " + exception_name);
return false;
}
}