summaryrefslogtreecommitdiff
path: root/src/helpers
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-08-20 11:47:06 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-08-20 11:47:06 +0200
commit7713daa86adf7980fd73cae40203ab6deb6be8b8 (patch)
treed30076975a2011519e7007fbc8265605f8fe02bb /src/helpers
parentfff118fa763d299958002684d2fdbfbb2e804d50 (diff)
compositor: log thrown runtime exceptions
Diffstat (limited to 'src/helpers')
-rw-r--r--src/helpers/MiscFunctions.cpp5
-rw-r--r--src/helpers/MiscFunctions.hpp3
2 files changed, 7 insertions, 1 deletions
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp
index acda2abd..7bf254ea 100644
--- a/src/helpers/MiscFunctions.cpp
+++ b/src/helpers/MiscFunctions.cpp
@@ -714,3 +714,8 @@ std::vector<SCallstackFrameInfo> getBacktrace() {
return callstack;
}
+
+void throwError(const std::string& err) {
+ Debug::log(CRIT, "Critical error thrown: %s", err.c_str());
+ throw std::runtime_error(err);
+}
diff --git a/src/helpers/MiscFunctions.hpp b/src/helpers/MiscFunctions.hpp
index c9e1f1b3..88598390 100644
--- a/src/helpers/MiscFunctions.hpp
+++ b/src/helpers/MiscFunctions.hpp
@@ -29,4 +29,5 @@ float getPlusMinusKeywordResult(std::string in, float
void matrixProjection(float mat[9], int w, int h, wl_output_transform tr);
double normalizeAngleRad(double ang);
std::string replaceInString(std::string subject, const std::string& search, const std::string& replace);
-std::vector<SCallstackFrameInfo> getBacktrace(); \ No newline at end of file
+std::vector<SCallstackFrameInfo> getBacktrace();
+void throwError(const std::string& err); \ No newline at end of file