mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-12-24 04:22:39 +00:00
Remove a lot of error code and error handling madness.
This commit is contained in:
29
MMCError.h
Normal file
29
MMCError.h
Normal file
@@ -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;
|
||||
};
|
||||
Reference in New Issue
Block a user