summaryrefslogtreecommitdiffstats
path: root/MMCError.h
diff options
context:
space:
mode:
Diffstat (limited to 'MMCError.h')
-rw-r--r--MMCError.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/MMCError.h b/MMCError.h
new file mode 100644
index 00000000..33591e06
--- /dev/null
+++ b/MMCError.h
@@ -0,0 +1,29 @@
+#pragma once
+#include <exception>
+#include <QString>
+#include <logger/QsLog.h>
+
+class MMCError : public std::exception
+{
+public:
+ MMCError(QString cause)
+ {
+ exceptionCause = cause;
+ QLOG_ERROR() << errorName() + ": " + cause;
+ };
+ virtual ~MMCError(){};
+ virtual const char *what() const noexcept
+ {
+ return exceptionCause.toLocal8Bit();
+ };
+ virtual QString cause() const
+ {
+ return exceptionCause;
+ }
+ virtual QString errorName()
+ {
+ return "MultiMC Error";
+ }
+private:
+ QString exceptionCause;
+}; \ No newline at end of file