AetheriaStores.Open: a missing catalog throws FileNotFoundException

The test assembly registers a catalog [CultGlobal], so the global check already threw on a missing
file there and AStoreRefusesAMissingCatalog passed against the old Open (run at fe9da2e: 12 passed).
The refusal is now a FileNotFoundException naming the path, and the test pins that type, which the
global check never throws. Builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-10 07:28:04 +02:00
commit 1521c68a79
2 changed files with 3 additions and 2 deletions

View file

@ -18,7 +18,7 @@ public static class AetheriaStores
{
// A read-only open of an absent catalog would hydrate an empty game; a shipped player missing its catalog stops here.
if (!catalogWritable && !File.Exists(catalogPath))
throw new InvalidOperationException($"Catalog {catalogPath} does not exist; a read-only open never invents one.");
throw new FileNotFoundException($"Catalog {catalogPath} does not exist; a read-only open never invents one.", catalogPath);
var cache = new CultCache();
try
{

View file

@ -209,7 +209,8 @@ public sealed class AetheriaStoresTests : IDisposable
{
var missing = Path.Combine(_root, "absent", "Aetheria.cc");
var error = Assert.Throws<InvalidOperationException>(() => AetheriaStores.Open(missing));
// FileNotFoundException, not the catalog-global check: that one also throws on a missing file whenever a global is registered.
var error = Assert.Throws<FileNotFoundException>(() => AetheriaStores.Open(missing));
Assert.Contains(missing, error.Message);
Assert.False(File.Exists(missing));
Assert.False(Directory.Exists(Path.GetDirectoryName(missing)));