Method RefuseWhatCannotBeCommitted
- Namespace
- MailFathom.Infrastructure.Persistence.Settings
- Assembly
- MailFathom.Infrastructure.dll
RefuseWhatCannotBeCommitted(string, long)
Refuses a candidate no statement should be issued for.
public static void RefuseWhatCannotBeCommitted(string json, long expectedVersion)
Parameters
jsonstringThe candidate document.
expectedVersionlongThe version the candidate was composed over.
Remarks
Every refusal here is an ArgumentException because every one of them is a candidate this build
composed wrongly rather than anything the database has an opinion about. The jsonb cast refuses text that
is not JSON and nothing beyond it, so a reader's JsonException is translated rather than allowed
to escape as itself: the caller either supplied a document or did not, and one exception type says so.
Exceptions
- ArgumentException
Thrown when
jsonis not JSON at all, is JSON of a shape no configuration layer composes from, or is past what the layer composes settings from.- ArgumentOutOfRangeException
Thrown when
expectedVersionis negative.