aboutsummaryrefslogtreecommitdiff
path: root/application/pages
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@users.noreply.github.com>2021-04-08 21:29:10 +0200
committerGitHub <noreply@github.com>2021-04-08 21:29:10 +0200
commit4ca481b2b34e711112eb7a257fc2385c0dce9dd2 (patch)
tree71de507b05d1a184031b4679fca25a288f87548a /application/pages
parente5804b1279cd0588d9434f298675ccd89fe21fc8 (diff)
parent524fc5b6ecf9e5f193db1173164ae23c6e6702b1 (diff)
downloadPrismLauncher-4ca481b2b34e711112eb7a257fc2385c0dce9dd2.tar.gz
PrismLauncher-4ca481b2b34e711112eb7a257fc2385c0dce9dd2.tar.bz2
PrismLauncher-4ca481b2b34e711112eb7a257fc2385c0dce9dd2.zip
Merge pull request #3715 from jamierocks/atl-trycatch-json
NOISSUE Fedora build, ATL exceptions, and language tweaks
Diffstat (limited to 'application/pages')
-rw-r--r--application/pages/modplatform/atlauncher/AtlListModel.cpp (renamed from application/pages/modplatform/atlauncher/AtlModel.cpp)13
-rw-r--r--application/pages/modplatform/atlauncher/AtlListModel.h (renamed from application/pages/modplatform/atlauncher/AtlModel.h)0
-rw-r--r--application/pages/modplatform/atlauncher/AtlPage.h2
3 files changed, 12 insertions, 3 deletions
diff --git a/application/pages/modplatform/atlauncher/AtlModel.cpp b/application/pages/modplatform/atlauncher/AtlListModel.cpp
index 4b1b1c8e..f3be6198 100644
--- a/application/pages/modplatform/atlauncher/AtlModel.cpp
+++ b/application/pages/modplatform/atlauncher/AtlListModel.cpp
@@ -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;
diff --git a/application/pages/modplatform/atlauncher/AtlModel.h b/application/pages/modplatform/atlauncher/AtlListModel.h
index 2d30a64e..2d30a64e 100644
--- a/application/pages/modplatform/atlauncher/AtlModel.h
+++ b/application/pages/modplatform/atlauncher/AtlListModel.h
diff --git a/application/pages/modplatform/atlauncher/AtlPage.h b/application/pages/modplatform/atlauncher/AtlPage.h
index 368de666..715cf5f4 100644
--- a/application/pages/modplatform/atlauncher/AtlPage.h
+++ b/application/pages/modplatform/atlauncher/AtlPage.h
@@ -16,7 +16,7 @@
#pragma once
#include "AtlFilterModel.h"
-#include "AtlModel.h"
+#include "AtlListModel.h"
#include <QWidget>