NOISSUE Handle JSON exceptions in ATLauncher support
Thanks to phit for pointing this out :)
This commit is contained in:
parent
3a1abb555b
commit
d6dc22d57c
@ -125,13 +125,12 @@ SET(MULTIMC_SOURCES
|
||||
pages/modplatform/VanillaPage.cpp
|
||||
pages/modplatform/VanillaPage.h
|
||||
|
||||
pages/modplatform/atlauncher/AtlModel.cpp
|
||||
pages/modplatform/atlauncher/AtlModel.h
|
||||
pages/modplatform/atlauncher/AtlFilterModel.cpp
|
||||
pages/modplatform/atlauncher/AtlFilterModel.h
|
||||
pages/modplatform/atlauncher/AtlListModel.cpp
|
||||
pages/modplatform/atlauncher/AtlListModel.h
|
||||
pages/modplatform/atlauncher/AtlPage.cpp
|
||||
pages/modplatform/atlauncher/AtlPage.h
|
||||
pages/modplatform/atlauncher/AtlPage.h
|
||||
|
||||
pages/modplatform/ftb/FtbFilterModel.cpp
|
||||
pages/modplatform/ftb/FtbFilterModel.h
|
||||
|
@ -1,8 +1,9 @@
|
||||
#include "AtlModel.h"
|
||||
#include "AtlListModel.h"
|
||||
|
||||
#include <BuildConfig.h>
|
||||
#include <MultiMC.h>
|
||||
#include <Env.h>
|
||||
#include <Json.h>
|
||||
|
||||
namespace Atl {
|
||||
|
||||
@ -99,7 +100,15 @@ void ListModel::requestFinished()
|
||||
auto packObj = packRaw.toObject();
|
||||
|
||||
ATLauncher::IndexedPack pack;
|
||||
ATLauncher::loadIndexedPack(pack, packObj);
|
||||
|
||||
try {
|
||||
ATLauncher::loadIndexedPack(pack, packObj);
|
||||
}
|
||||
catch (const JSONValidationError &e) {
|
||||
qDebug() << QString::fromUtf8(response);
|
||||
qWarning() << "Error while reading pack manifest from ATLauncher: " << e.cause();
|
||||
return;
|
||||
}
|
||||
|
||||
// ignore packs without a published version
|
||||
if(pack.versions.length() == 0) continue;
|
@ -16,7 +16,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "AtlFilterModel.h"
|
||||
#include "AtlModel.h"
|
||||
#include "AtlListModel.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user