Named malformed history manifests

- Truncated or malformed generation manifests and epoch metadata report as invalid history again after the strict reader change
- The datapack metadata test expects the range and supported_formats to start at the 1.21.1 format
This commit is contained in:
Brian Neumann-Fopiano committed 2026-10-16 12:07:36 -04:00
1 parent 478fd4d350
commit 64e4c82716
2 files changed
+10 -3

No files matched your search

@@ -10,7 +10,9 @@ import com.google.gson.JsonParseException;
import art.arcane.volmlib.util.json.StrictJsonReader;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.MalformedJsonException;
import java.io.EOFException;
import java.io.File;
import java.io.IOException;
import java.io.Reader;
@@ -247,7 +249,8 @@ public final class GenerationHistoryStore {
epochs.add(readEpoch(manifestPath.getParent(), reference.getAsString()));
}
return GenerationManifest.fromJson(index, epochs);
} catch (JsonParseException | IllegalArgumentException | ArithmeticException exception) {
} catch (JsonParseException | MalformedJsonException | EOFException | IllegalArgumentException
| ArithmeticException exception) {
throw new IOException("Invalid generation manifest: " + manifestPath, exception);
}
}
@@ -324,7 +327,7 @@ public final class GenerationHistoryStore {
throw new IOException("Generation epoch metadata identity differs from its reference: " + metadata);
}
return epoch;
} catch (JsonParseException | IllegalArgumentException exception) {
} catch (JsonParseException | MalformedJsonException | EOFException | IllegalArgumentException exception) {
throw new IOException("Invalid generation epoch metadata: " + metadata, exception);
}
}