Skip to content

Commit

Permalink
Translate exception message.
Browse files Browse the repository at this point in the history
  • Loading branch information
burningtnt committed Jan 25, 2025
1 parent 01f9a45 commit f655bba
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,13 @@ public void execute() throws Exception {
for (Path patchJson : directoryStream) {
if (patchJson.toString().endsWith(".json")) {
// If json is malformed, we should stop installing this modpack instead of skipping it.
MultiMCInstancePatch multiMCPatch = JsonUtils.GSON.fromJson(FileUtils.readText(patchJson), MultiMCInstancePatch.class);
MultiMCInstancePatch multiMCPatch;

try {
multiMCPatch = JsonUtils.GSON.fromJson(FileUtils.readText(patchJson), MultiMCInstancePatch.class);
} catch (JsonParseException e) {
throw new IllegalArgumentException("Cannot parse MultiMC patch json: " + patchJson);
}

List<String> arguments = new ArrayList<>();
for (String arg : multiMCPatch.getTweakers()) {
Expand Down

0 comments on commit f655bba

Please sign in to comment.