Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cf: gracefully handle invalid modpack manifest file #503

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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