ShipAuthoring: Load follows the pull's InvalidDataException, RefuseLegacyEmbeddedHull the nil-stamp NotSupportedException

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-10-22 20:23:32 +02:00
commit fb8f2ea2fb
2 changed files with 24 additions and 3 deletions

View file

@ -136,7 +136,7 @@ public static class ShipAuthoringStore
{
RefuseLegacyEmbeddedHull(path);
try { return LoadRecords(path); }
catch (MessagePackSerializationException error)
catch (Exception error) when (error is InvalidDataException or MessagePackSerializationException)
{
throw new InvalidOperationException($"{path}: a record does not decode as its schema: {error.Message}", error);
}
@ -152,7 +152,7 @@ public static class ShipAuthoringStore
if (bytes.Length == 0) return;
CultPersistedStoreSnapshot snapshot;
try { snapshot = CultDocumentMessagePackSerialization.DeserializeSnapshot(bytes); }
catch (MessagePackSerializationException error)
catch (Exception error) when (error is MessagePackSerializationException or NotSupportedException)
{
throw new InvalidOperationException($"{path}: not a readable ship file: {error.Message}", error);
}