summaryrefslogtreecommitdiffstats
path: root/logic/VersionFile.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-03-09 23:42:25 +0100
committerPetr Mrázek <peterix@gmail.com>2014-03-09 23:42:25 +0100
commitb2c803a378695026f12aabc3729eb2139bee1b2c (patch)
tree0629e45a270f15941bf0013ccc458d23c74b77d2 /logic/VersionFile.h
parentffff2cd3248a574d3d666731580ac7b8c33e1735 (diff)
downloadMultiMC-b2c803a378695026f12aabc3729eb2139bee1b2c.tar
MultiMC-b2c803a378695026f12aabc3729eb2139bee1b2c.tar.gz
MultiMC-b2c803a378695026f12aabc3729eb2139bee1b2c.tar.lz
MultiMC-b2c803a378695026f12aabc3729eb2139bee1b2c.tar.xz
MultiMC-b2c803a378695026f12aabc3729eb2139bee1b2c.zip
Improve reporting of version file errors.x
Diffstat (limited to 'logic/VersionFile.h')
-rw-r--r--logic/VersionFile.h36
1 files changed, 31 insertions, 5 deletions
diff --git a/logic/VersionFile.h b/logic/VersionFile.h
index 504fcbff..67d22b23 100644
--- a/logic/VersionFile.h
+++ b/logic/VersionFile.h
@@ -13,13 +13,39 @@ class VersionBuildError : public MMCError
{
public:
VersionBuildError(QString cause) : MMCError(cause) {};
- virtual QString errorName()
- {
- return "VersionBuildError";
- };
virtual ~VersionBuildError() {};
};
+/**
+ * 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() {};
+};
+
+/**
+ * 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() {};
+};
+
struct RawLibrary;
typedef std::shared_ptr<RawLibrary> RawLibraryPtr;
struct RawLibrary
@@ -61,7 +87,7 @@ struct VersionFile
{
public: /* methods */
static VersionFilePtr fromJson(const QJsonDocument &doc, const QString &filename,
- const bool requireOrder, const bool isFTB = false);
+ const bool requireOrder, const bool isFTB = false);
static OneSixLibraryPtr createLibrary(RawLibraryPtr lib);
int findLibrary(QList<OneSixLibraryPtr> haystack, const QString &needle);