diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-03-02 19:12:04 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-03-02 19:12:04 +0100 |
commit | 28ad9befdcac246eb69a434be970abc29a80bc80 (patch) | |
tree | 330451feee32c4163b02132076491ad4fd311e9b /MMCError.h | |
parent | 80d146866c8c5f00c6d790b476a774def71010bf (diff) | |
download | MultiMC-28ad9befdcac246eb69a434be970abc29a80bc80.tar MultiMC-28ad9befdcac246eb69a434be970abc29a80bc80.tar.gz MultiMC-28ad9befdcac246eb69a434be970abc29a80bc80.tar.lz MultiMC-28ad9befdcac246eb69a434be970abc29a80bc80.tar.xz MultiMC-28ad9befdcac246eb69a434be970abc29a80bc80.zip |
Remove a lot of error code and error handling madness.
Diffstat (limited to 'MMCError.h')
-rw-r--r-- | MMCError.h | 29 |
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 |