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:
parent
bd0293d683
commit
fb8f2ea2fb
2 changed files with 24 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue