From 28ad9befdcac246eb69a434be970abc29a80bc80 Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Sun, 2 Mar 2014 19:12:04 +0100 Subject: Remove a lot of error code and error handling madness. --- MMCError.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 MMCError.h (limited to 'MMCError.h') 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 +#include +#include + +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 -- cgit