Class MemoryPatchCommitException
- Namespace
- CStructSharp.Memory
- Assembly
- CStructSharp.dll
A write failed after a patch commit had started changing bytes. Reports how much is confirmed and which fragment is uncertain.
public sealed class MemoryPatchCommitException : CStructWriteException, ISerializable
- Inheritance
-
MemoryPatchCommitException
- Implements
- Inherited Members
Remarks
This exception is thrown only from the write phase of Commit(MemoryAccessContext?); validation failures before the first write keep their ordinary exception types because nothing was changed. The class is a CStructWriteException with WriteFailed, so one handler can catch every CStructSharp write failure. Its meaning is precise: every fragment before FragmentIndex returned success and contributes to CompletedBytes; the fragment at FragmentIndex threw and may have written any prefix of its bytes, even when CompletedBytes is zero. InnerException holds the transport, budget, or cancellation cause.
There is no rollback, because arbitrary sources share no transaction. Inspect or discard the affected offline copy and re-plan from a known state; retrying the same patch is not a recovery protocol.
Properties
CompletedBytes
Gets the total bytes of fragments confirmed written before the failing one.
public long CompletedBytes { get; }
Property Value
FragmentIndex
Gets the zero-based index of the fragment whose completion is uncertain.
public int FragmentIndex { get; }