GH-1856 Make MultiMC fail hard when things are missing

Things like:
* jar mods
* valid version files
This commit is contained in:
Petr Mrázek
2017-04-23 02:31:13 +02:00
parent b414bbe395
commit 3f24c4cfe5
12 changed files with 57 additions and 98 deletions

View File

@ -23,7 +23,6 @@
#include "OneSixProfileStrategy.h"
#include "minecraft/MinecraftProfile.h"
#include "minecraft/VersionBuildError.h"
#include "minecraft/launch/ModMinecraftJar.h"
#include "MMCZip.h"

View File

@ -2,7 +2,6 @@
#include "OneSixInstance.h"
#include "OneSixVersionFormat.h"
#include "minecraft/VersionBuildError.h"
#include "Env.h"
#include <FileSystem.h>
@ -107,10 +106,6 @@ void OneSixProfileStrategy::loadDefaultBuiltinPatches()
profilePatch = std::make_shared<ProfilePatch>(metaVersion);
profilePatch->setVanilla(true);
}
if (!profilePatch)
{
throw VersionIncomplete(uid);
}
profilePatch->setOrder(order);
profile->appendPatch(profilePatch);
};
@ -291,6 +286,7 @@ bool OneSixProfileStrategy::customizePatch(ProfilePatchPtr patch)
{
return false;
}
// FIXME: get rid of this try-catch.
try
{
QSaveFile jsonFile(filename);
@ -311,10 +307,6 @@ bool OneSixProfileStrategy::customizePatch(ProfilePatchPtr patch)
}
load();
}
catch (VersionIncomplete &error)
{
qDebug() << "Version was incomplete:" << error.cause();
}
catch (Exception &error)
{
qWarning() << "Version could not be loaded:" << error.cause();
@ -337,14 +329,11 @@ bool OneSixProfileStrategy::revertPatch(ProfilePatchPtr patch)
}
// just kill the file and reload
bool result = QFile::remove(filename);
// FIXME: get rid of this try-catch.
try
{
load();
}
catch (VersionIncomplete &error)
{
qDebug() << "Version was incomplete:" << error.cause();
}
catch (Exception &error)
{
qWarning() << "Version could not be loaded:" << error.cause();

View File

@ -1,7 +1,6 @@
#include "OneSixVersionFormat.h"
#include <Json.h>
#include "minecraft/ParseUtils.h"
#include <minecraft/VersionBuildError.h>
#include <minecraft/MojangVersionFormat.h>
using namespace Json;