A record whose schema id the catalog lists only as a compatible id now opens (the cache resolved a persisted schema by entry id alone). CultMesh's fallback to the older catalog-entry reader fires only for a store in that layout, decided by the entry's slot 5, not for any decode failure, so a current-layout store with a malformed slot is refused as CultCache refuses it. CultStoreUnreadableException.Path names the refused file. New vectors: compatible-id-only-v3 (accepted by all four) and three current-layout catalogs with one malformed slot. The contract states the writer's invariant. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
22 lines
1 KiB
C#
22 lines
1 KiB
C#
using System;
|
|
|
|
namespace GameCult.Caching
|
|
{
|
|
/// <summary>
|
|
/// A store file this runtime cannot read: not exactly one complete store (truncated, bytes after it, a value that is not a
|
|
/// store, a missing or extra top-level slot), a format or record it does not know, or a body it cannot decode. Open, flush,
|
|
/// commit and CultMesh's single-file reads all refuse a file with this one exception, and a refused file is left as it was.
|
|
/// The underlying cause, where there is one, is the inner exception, and <see cref="Path"/> names the file.
|
|
/// </summary>
|
|
public sealed class CultStoreUnreadableException : NotSupportedException
|
|
{
|
|
public CultStoreUnreadableException(string message, string? path = null, Exception? innerException = null)
|
|
: base(message, innerException)
|
|
{
|
|
Path = path;
|
|
}
|
|
|
|
/// <summary>The store file that was refused, or null when the bytes were read without a file.</summary>
|
|
public string? Path { get; }
|
|
}
|
|
}
|