Skip to content

Commit

Permalink
cf: gracefully handle invalid modpack manifest file (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
itzg authored Jan 6, 2025
1 parent 80723b2 commit 2068d21
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import static me.itzg.helpers.curseforge.CurseForgeApiClient.modFileDownloadStatusHandler;
import static me.itzg.helpers.singles.MoreCollections.safeStreamFrom;

import com.fasterxml.jackson.databind.JsonMappingException;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -983,6 +984,8 @@ private MinecraftModpackManifest extractModpackManifest(Path modpackZip) throws
if (entry != null) {
try (InputStream in = zipFile.getInputStream(entry)) {
return ObjectMappers.defaultMapper().readValue(in, MinecraftModpackManifest.class);
} catch (JsonMappingException e) {
throw new InvalidParameterException("The modpack's manifest file was not valid -- did you make sure to reference a client, not server, file?", e);
}
}
}
Expand Down

0 comments on commit 2068d21

Please sign in to comment.