summaryrefslogtreecommitdiffstats
path: root/libraries/logic/minecraft/VersionBuildError.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-04-10 04:29:29 +0200
committerPetr Mrázek <peterix@gmail.com>2016-04-30 23:59:23 +0200
commit47e37635f50c09b4f9a9ee7699e3120bab3e4088 (patch)
tree061c2f675fb7e244ebe4b54ef206bfbd615c91f8 /libraries/logic/minecraft/VersionBuildError.h
parentfcd4a482f759cd58ee319a51082d0146b7e426e2 (diff)
downloadMultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar
MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar.gz
MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar.lz
MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar.xz
MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.zip
NOISSUE split GUI stuff from logic library
Diffstat (limited to 'libraries/logic/minecraft/VersionBuildError.h')
-rw-r--r--libraries/logic/minecraft/VersionBuildError.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/libraries/logic/minecraft/VersionBuildError.h b/libraries/logic/minecraft/VersionBuildError.h
new file mode 100644
index 00000000..fda453e5
--- /dev/null
+++ b/libraries/logic/minecraft/VersionBuildError.h
@@ -0,0 +1,58 @@
+#include "Exception.h"
+
+class VersionBuildError : public Exception
+{
+public:
+ explicit VersionBuildError(QString cause) : Exception(cause) {}
+ virtual ~VersionBuildError() noexcept
+ {
+ }
+};
+
+/**
+ * the base version file was meant for a newer version of the vanilla launcher than we support
+ */
+class LauncherVersionError : public VersionBuildError
+{
+public:
+ LauncherVersionError(int actual, int supported)
+ : VersionBuildError(QObject::tr(
+ "The base version file of this instance was meant for a newer (%1) "
+ "version of the vanilla launcher than this version of MultiMC supports (%2).")
+ .arg(actual)
+ .arg(supported)) {};
+ virtual ~LauncherVersionError() noexcept
+ {
+ }
+};
+
+/**
+ * some patch was intended for a different version of minecraft
+ */
+class MinecraftVersionMismatch : public VersionBuildError
+{
+public:
+ MinecraftVersionMismatch(QString fileId, QString mcVersion, QString parentMcVersion)
+ : VersionBuildError(QObject::tr("The patch %1 is for a different version of Minecraft "
+ "(%2) than that of the instance (%3).")
+ .arg(fileId)
+ .arg(mcVersion)
+ .arg(parentMcVersion)) {};
+ virtual ~MinecraftVersionMismatch() noexcept
+ {
+ }
+};
+
+/**
+ * files required for the version are not (yet?) present
+ */
+class VersionIncomplete : public VersionBuildError
+{
+public:
+ VersionIncomplete(QString missingPatch)
+ : VersionBuildError(QObject::tr("Version is incomplete: missing %1.")
+ .arg(missingPatch)) {};
+ virtual ~VersionIncomplete() noexcept
+ {
+ }
+};